Fossil

Check-in [b5f0d703]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove a redundant directory separator character from the temporary filenames generated on windows.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:b5f0d70362be0312f58a7c1857a1165dd97a5b40f396c018658d52f5678e58a9
User & Date: drh 2017-08-23 17:38:15
Context
2017-08-23
17:53
Change the file_mkfolder() implementation to assume that the folder already exists and only go about creating it and its path if it does not previously exit. check-in: 92ea6183 user: drh tags: trunk
17:38
Remove a redundant directory separator character from the temporary filenames generated on windows. check-in: b5f0d703 user: drh tags: trunk
17:29
Add the test-tempname command for testing the file_tempname() routine. check-in: f1d23f04 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/file.c.

1411
1412
1413
1414
1415
1416
1417




1418
1419
1420
1421
1422
1423
1424
  char zRand[16];

#if defined(_WIN32)
  wchar_t zTmpPath[MAX_PATH];

  if( GetTempPathW(MAX_PATH, zTmpPath) ){
    azDirs[0] = fossil_path_to_utf8(zTmpPath);




  }

  azDirs[1] = fossil_getenv("TEMP");
  azDirs[2] = fossil_getenv("TMP");
#else
  azDirs[0] = fossil_getenv("TMPDIR");
#endif







>
>
>
>







1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
  char zRand[16];

#if defined(_WIN32)
  wchar_t zTmpPath[MAX_PATH];

  if( GetTempPathW(MAX_PATH, zTmpPath) ){
    azDirs[0] = fossil_path_to_utf8(zTmpPath);
    /* Removing trailing \ from the temp path */
    z = (char*)azDirs[0];
    i = (int)strlen(z)-1;
    if( i>0 && z[i]=='\\' ) z[i] = 0;
  }

  azDirs[1] = fossil_getenv("TEMP");
  azDirs[2] = fossil_getenv("TMP");
#else
  azDirs[0] = fossil_getenv("TMPDIR");
#endif