Fossil SCM

Use a standard .txt extension for temporary files and avoid double dots in file name.

andybradford 2017-05-29 17:02 UTC amend-regress
Commit 51058ce141f083060dc2ae373ff62bfcff7ddbc93977c1fbf4c1a345d5732148
2 files changed +1 -1 +1 -1
+1 -1
--- src/checkin.c
+++ src/checkin.c
@@ -1208,11 +1208,11 @@
12081208
file_relative_name(g.zLocalRoot, &fname, 1);
12091209
zFile = db_text(0, "SELECT '%qci-comment-'||hex(randomblob(6))||'.txt'",
12101210
blob_str(&fname));
12111211
}else{
12121212
file_tempname(&fname, "ci-comment");
1213
- zFile = db_text(0, "SELECT '%q'||'.txt'", blob_str(&fname));
1213
+ zFile = mprintf("%s", blob_str(&fname));
12141214
}
12151215
blob_reset(&fname);
12161216
}
12171217
#if defined(_WIN32)
12181218
blob_add_cr(pPrompt);
12191219
--- src/checkin.c
+++ src/checkin.c
@@ -1208,11 +1208,11 @@
1208 file_relative_name(g.zLocalRoot, &fname, 1);
1209 zFile = db_text(0, "SELECT '%qci-comment-'||hex(randomblob(6))||'.txt'",
1210 blob_str(&fname));
1211 }else{
1212 file_tempname(&fname, "ci-comment");
1213 zFile = db_text(0, "SELECT '%q'||'.txt'", blob_str(&fname));
1214 }
1215 blob_reset(&fname);
1216 }
1217 #if defined(_WIN32)
1218 blob_add_cr(pPrompt);
1219
--- src/checkin.c
+++ src/checkin.c
@@ -1208,11 +1208,11 @@
1208 file_relative_name(g.zLocalRoot, &fname, 1);
1209 zFile = db_text(0, "SELECT '%qci-comment-'||hex(randomblob(6))||'.txt'",
1210 blob_str(&fname));
1211 }else{
1212 file_tempname(&fname, "ci-comment");
1213 zFile = mprintf("%s", blob_str(&fname));
1214 }
1215 blob_reset(&fname);
1216 }
1217 #if defined(_WIN32)
1218 blob_add_cr(pPrompt);
1219
+1 -1
--- src/file.c
+++ src/file.c
@@ -1435,11 +1435,11 @@
14351435
sqlite3_randomness(15, zRand);
14361436
for(i=0; i<15; i++){
14371437
zRand[i] = (char)zChars[ ((unsigned char)zRand[i])%(sizeof(zChars)-1) ];
14381438
}
14391439
zRand[15] = 0;
1440
- blob_appendf(pBuf, "%s/%s.%s", zDir, zPrefix ? zPrefix : "", zRand);
1440
+ blob_appendf(pBuf, "%s/%s-%s.txt", zDir, zPrefix ? zPrefix : "", zRand);
14411441
}while( file_size(blob_str(pBuf))>=0 );
14421442
14431443
#if defined(_WIN32)
14441444
fossil_path_free((char *)azDirs[0]);
14451445
fossil_path_free((char *)azDirs[1]);
14461446
--- src/file.c
+++ src/file.c
@@ -1435,11 +1435,11 @@
1435 sqlite3_randomness(15, zRand);
1436 for(i=0; i<15; i++){
1437 zRand[i] = (char)zChars[ ((unsigned char)zRand[i])%(sizeof(zChars)-1) ];
1438 }
1439 zRand[15] = 0;
1440 blob_appendf(pBuf, "%s/%s.%s", zDir, zPrefix ? zPrefix : "", zRand);
1441 }while( file_size(blob_str(pBuf))>=0 );
1442
1443 #if defined(_WIN32)
1444 fossil_path_free((char *)azDirs[0]);
1445 fossil_path_free((char *)azDirs[1]);
1446
--- src/file.c
+++ src/file.c
@@ -1435,11 +1435,11 @@
1435 sqlite3_randomness(15, zRand);
1436 for(i=0; i<15; i++){
1437 zRand[i] = (char)zChars[ ((unsigned char)zRand[i])%(sizeof(zChars)-1) ];
1438 }
1439 zRand[15] = 0;
1440 blob_appendf(pBuf, "%s/%s-%s.txt", zDir, zPrefix ? zPrefix : "", zRand);
1441 }while( file_size(blob_str(pBuf))>=0 );
1442
1443 #if defined(_WIN32)
1444 fossil_path_free((char *)azDirs[0]);
1445 fossil_path_free((char *)azDirs[1]);
1446

Keyboard Shortcuts

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