Fossil

Check-in [5f23fbad]
Login

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

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:5f23fbad37cdc2c42bb08d46ff4581584624e36d
User & Date: drh 2010-12-22 23:43:17
Context
2010-12-23
02:22
Add new function fossil_strcmp() that works like strcmp() except that it handles NULL arguments correctly. Use fossil_strcmp() in place of strcmp() in many places in the code. check-in: 31c52c7b user: drh tags: trunk
2010-12-22
23:57
First cut at code to allow anonymous users to self-register. check-in: fedf27e4 user: drh tags: self-register
23:43
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. check-in: 5f23fbad user: drh tags: trunk
22:33
Do not overwrite files on disk, and especially do not prompt the user for permission to overwrite, if there would ultimately be no change in the file content. check-in: aa9ea796 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vfile.c.

248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
    zName = db_column_text(&q, 1);
    rid = db_column_int(&q, 2);
    content_get(rid, &content);
    if( file_is_the_same(&content, zName) ){
      blob_reset(&content);
      continue;
    }
    if( promptFlag ){
      Blob ans;
      char *zMsg;
      char cReply;
      zMsg = mprintf("overwrite %s (a=always/y/N)? ", zName);
      prompt_user(zMsg, &ans);
      free(zMsg);
      cReply = blob_str(&ans)[0];







|







248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
    zName = db_column_text(&q, 1);
    rid = db_column_int(&q, 2);
    content_get(rid, &content);
    if( file_is_the_same(&content, zName) ){
      blob_reset(&content);
      continue;
    }
    if( promptFlag && file_size(zName)>=0 ){
      Blob ans;
      char *zMsg;
      char cReply;
      zMsg = mprintf("overwrite %s (a=always/y/N)? ", zName);
      prompt_user(zMsg, &ans);
      free(zMsg);
      cReply = blob_str(&ans)[0];