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.
Commit
5f23fbad37cdc2c42bb08d46ff4581584624e36d
Parent
aa9ea7961afe45e…
1 file changed
+1
-1
+1
-1
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -250,11 +250,11 @@ | ||
| 250 | 250 | content_get(rid, &content); |
| 251 | 251 | if( file_is_the_same(&content, zName) ){ |
| 252 | 252 | blob_reset(&content); |
| 253 | 253 | continue; |
| 254 | 254 | } |
| 255 | - if( promptFlag ){ | |
| 255 | + if( promptFlag && file_size(zName)>=0 ){ | |
| 256 | 256 | Blob ans; |
| 257 | 257 | char *zMsg; |
| 258 | 258 | char cReply; |
| 259 | 259 | zMsg = mprintf("overwrite %s (a=always/y/N)? ", zName); |
| 260 | 260 | prompt_user(zMsg, &ans); |
| 261 | 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 ){ |
| 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 |