From 8cdfb14c428c4e13808bcdfafcb6c5b5b6e06056 Mon Sep 17 00:00:00 2001 From: timm Date: Fri, 8 May 1998 20:19:43 +0000 Subject: [PATCH] fix getFolder to return windows style path git-svn-id: svn://10.0.0.236/trunk@1342 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/cmd/dialup/as_html/globals1.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/mozilla/cmd/dialup/as_html/globals1.js b/mozilla/cmd/dialup/as_html/globals1.js index 8d94970bb83..3edafc6aede 100644 --- a/mozilla/cmd/dialup/as_html/globals1.js +++ b/mozilla/cmd/dialup/as_html/globals1.js @@ -73,7 +73,7 @@ function SetNameValuePair( file, section, variable, data ) function getConfigFolder( object ) { var pathName; - pathName = getFolder( object ) + "Config/"; + pathName = getFolder( object ) + "Config" + "\\"; //debug( "getConfigFolder: " + pathName ); @@ -104,10 +104,9 @@ function getPlatform() function getFolder( window ) { platform = getPlatform(); - + if ( platform == "Macintosh" ) { // Macintosh support - var path = unescape( window.location.pathname ); if ( ( x = path.lastIndexOf( "/" ) ) > 0 ) path = path.substring( 0, x + 1 ); @@ -126,16 +125,24 @@ function getFolder( window ) // note: JavaScript returns path with '/' instead of '\' var path = unescape( window.location.pathname ); + var drive = "|"; + // gets the drive letter and directory path if ( ( x = path.lastIndexOf( "|" ) ) > 0 ) { - var drive = path.substring( path.indexOf( '/' ) + 1, path.indexOf( '|' ) ); - var dirPath = path.substring( path.indexOf( '|' ) + 1, path.lastIndexOf( '/' ) + 1 ); + drive = path.substring( path.indexOf( '/' ) + 1, path.indexOf( '|' ) ); + path = path.substring( path.indexOf( '|' ) + 1, path.lastIndexOf( '/' ) + 1 ); } + var pathArray = path.split( "/" ); + path = pathArray.join( "\\" ); + + //debug( "drive: " + drive + " path: " + path ); + // construct newpath - newpath = drive + ":" + dirPath; + newpath = drive + ":" + path + "\\"; + debug( "path: " + newpath ); } return newpath; }