Fossil SCM

Remove a redundant directory separator character from the temporary filenames generated on windows.

drh 2017-08-23 17:38 trunk
Commit b5f0d70362be0312f58a7c1857a1165dd97a5b40f396c018658d52f5678e58a9
1 file changed +4
+4
--- src/file.c
+++ src/file.c
@@ -1413,10 +1413,14 @@
14131413
#if defined(_WIN32)
14141414
wchar_t zTmpPath[MAX_PATH];
14151415
14161416
if( GetTempPathW(MAX_PATH, zTmpPath) ){
14171417
azDirs[0] = fossil_path_to_utf8(zTmpPath);
1418
+ /* Removing trailing \ from the temp path */
1419
+ z = (char*)azDirs[0];
1420
+ i = (int)strlen(z)-1;
1421
+ if( i>0 && z[i]=='\\' ) z[i] = 0;
14181422
}
14191423
14201424
azDirs[1] = fossil_getenv("TEMP");
14211425
azDirs[2] = fossil_getenv("TMP");
14221426
#else
14231427
--- src/file.c
+++ src/file.c
@@ -1413,10 +1413,14 @@
1413 #if defined(_WIN32)
1414 wchar_t zTmpPath[MAX_PATH];
1415
1416 if( GetTempPathW(MAX_PATH, zTmpPath) ){
1417 azDirs[0] = fossil_path_to_utf8(zTmpPath);
 
 
 
 
1418 }
1419
1420 azDirs[1] = fossil_getenv("TEMP");
1421 azDirs[2] = fossil_getenv("TMP");
1422 #else
1423
--- src/file.c
+++ src/file.c
@@ -1413,10 +1413,14 @@
1413 #if defined(_WIN32)
1414 wchar_t zTmpPath[MAX_PATH];
1415
1416 if( GetTempPathW(MAX_PATH, zTmpPath) ){
1417 azDirs[0] = fossil_path_to_utf8(zTmpPath);
1418 /* Removing trailing \ from the temp path */
1419 z = (char*)azDirs[0];
1420 i = (int)strlen(z)-1;
1421 if( i>0 && z[i]=='\\' ) z[i] = 0;
1422 }
1423
1424 azDirs[1] = fossil_getenv("TEMP");
1425 azDirs[2] = fossil_getenv("TMP");
1426 #else
1427

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button