Fossil SCM

Fix to the previous check-in so that it does not prompt the user to confirm overwrite if the file does not exist in the first place.

drh 2010-12-22 23:43 trunk
Commit 5f23fbad37cdc2c42bb08d46ff4581584624e36d
1 file changed +1 -1
+1 -1
--- src/vfile.c
+++ src/vfile.c
@@ -250,11 +250,11 @@
250250
content_get(rid, &content);
251251
if( file_is_the_same(&content, zName) ){
252252
blob_reset(&content);
253253
continue;
254254
}
255
- if( promptFlag ){
255
+ if( promptFlag && file_size(zName)>=0 ){
256256
Blob ans;
257257
char *zMsg;
258258
char cReply;
259259
zMsg = mprintf("overwrite %s (a=always/y/N)? ", zName);
260260
prompt_user(zMsg, &ans);
261261
--- src/vfile.c
+++ src/vfile.c
@@ -250,11 +250,11 @@
250 content_get(rid, &content);
251 if( file_is_the_same(&content, zName) ){
252 blob_reset(&content);
253 continue;
254 }
255 if( promptFlag ){
256 Blob ans;
257 char *zMsg;
258 char cReply;
259 zMsg = mprintf("overwrite %s (a=always/y/N)? ", zName);
260 prompt_user(zMsg, &ans);
261
--- src/vfile.c
+++ src/vfile.c
@@ -250,11 +250,11 @@
250 content_get(rid, &content);
251 if( file_is_the_same(&content, zName) ){
252 blob_reset(&content);
253 continue;
254 }
255 if( promptFlag && file_size(zName)>=0 ){
256 Blob ans;
257 char *zMsg;
258 char cReply;
259 zMsg = mprintf("overwrite %s (a=always/y/N)? ", zName);
260 prompt_user(zMsg, &ans);
261

Keyboard Shortcuts

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