Fossil

Check-in [56d624f6]
Login

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

Overview
Comment:Fix a bug in undo associated with symlinks.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 56d624f6e20fe0d339fad3b8705bb90b82e45e86
User & Date: drh 2011-09-02 12:33:17
Context
2011-09-02
12:39
Merge symlink fixes into trunk. check-in: c97535c5 user: dmitry tags: trunk
12:33
Fix a bug in undo associated with symlinks. check-in: 56d624f6 user: drh tags: trunk
12:18
Merge the latest autosetup changes into trunk. check-in: 172580e0 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/undo.c.

269
270
271
272
273
274
275

276

277
278
279
280
281
282
283
284
  int existsFlag;
  int isLink;
  Stmt q;

  if( !undoActive ) return;
  zFullname = mprintf("%s%s", g.zLocalRoot, zPathname);
  existsFlag = file_size(zFullname)>=0;

  db_prepare(&q,

    "INSERT OR IGNORE INTO undo(pathname,redoflag,existsflag,isExe,isLink,content)"
    " VALUES(%Q,0,%d,%d,%d,:c)",
    zPathname, existsFlag, file_isexe(zFullname), file_islink(zFullname)
  );
  if( existsFlag ){
    if( isLink ){
      blob_read_link(&content, zFullname); 
    }else{







>

>
|







269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
  int existsFlag;
  int isLink;
  Stmt q;

  if( !undoActive ) return;
  zFullname = mprintf("%s%s", g.zLocalRoot, zPathname);
  existsFlag = file_size(zFullname)>=0;
  isLink = file_islink(zFullname);
  db_prepare(&q,
    "INSERT OR IGNORE INTO"
    "   undo(pathname,redoflag,existsflag,isExe,isLink,content)"
    " VALUES(%Q,0,%d,%d,%d,:c)",
    zPathname, existsFlag, file_isexe(zFullname), file_islink(zFullname)
  );
  if( existsFlag ){
    if( isLink ){
      blob_read_link(&content, zFullname); 
    }else{