Fossil SCM
Fix saving undo for symlinks.
Commit
0762b1d9c6cc13b1c64669798da7ef74685fa54d
Parent
02ee688a4d15bf2…
1 file changed
+2
-1
+2
-1
| --- src/undo.c | ||
| +++ src/undo.c | ||
| @@ -271,14 +271,15 @@ | ||
| 271 | 271 | Stmt q; |
| 272 | 272 | |
| 273 | 273 | if( !undoActive ) return; |
| 274 | 274 | zFullname = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 275 | 275 | existsFlag = file_size(zFullname)>=0; |
| 276 | + isLink = file_islink(zFullname); | |
| 276 | 277 | db_prepare(&q, |
| 277 | 278 | "INSERT OR IGNORE INTO undo(pathname,redoflag,existsflag,isExe,isLink,content)" |
| 278 | 279 | " VALUES(%Q,0,%d,%d,%d,:c)", |
| 279 | - zPathname, existsFlag, file_isexe(zFullname), file_islink(zFullname) | |
| 280 | + zPathname, existsFlag, file_isexe(zFullname), isLink | |
| 280 | 281 | ); |
| 281 | 282 | if( existsFlag ){ |
| 282 | 283 | if( isLink ){ |
| 283 | 284 | blob_read_link(&content, zFullname); |
| 284 | 285 | }else{ |
| 285 | 286 |
| --- src/undo.c | |
| +++ src/undo.c | |
| @@ -271,14 +271,15 @@ | |
| 271 | Stmt q; |
| 272 | |
| 273 | if( !undoActive ) return; |
| 274 | zFullname = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 275 | existsFlag = file_size(zFullname)>=0; |
| 276 | db_prepare(&q, |
| 277 | "INSERT OR IGNORE INTO undo(pathname,redoflag,existsflag,isExe,isLink,content)" |
| 278 | " VALUES(%Q,0,%d,%d,%d,:c)", |
| 279 | zPathname, existsFlag, file_isexe(zFullname), file_islink(zFullname) |
| 280 | ); |
| 281 | if( existsFlag ){ |
| 282 | if( isLink ){ |
| 283 | blob_read_link(&content, zFullname); |
| 284 | }else{ |
| 285 |
| --- src/undo.c | |
| +++ src/undo.c | |
| @@ -271,14 +271,15 @@ | |
| 271 | Stmt q; |
| 272 | |
| 273 | if( !undoActive ) return; |
| 274 | zFullname = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 275 | existsFlag = file_size(zFullname)>=0; |
| 276 | isLink = file_islink(zFullname); |
| 277 | db_prepare(&q, |
| 278 | "INSERT OR IGNORE INTO undo(pathname,redoflag,existsflag,isExe,isLink,content)" |
| 279 | " VALUES(%Q,0,%d,%d,%d,:c)", |
| 280 | zPathname, existsFlag, file_isexe(zFullname), isLink |
| 281 | ); |
| 282 | if( existsFlag ){ |
| 283 | if( isLink ){ |
| 284 | blob_read_link(&content, zFullname); |
| 285 | }else{ |
| 286 |