View Ticket
Not logged in
Ticket UUID: 2245a1e3d058d85ec59c327a932a208109d46d45
Title: rm command mistakingly believes files are directories
Status: Closed Type: Code_Defect
Severity: Important Priority:
Subsystem: Resolution: Fixed
Last Modified: 2010-02-13 12:31:25
Version Found In: 95ae79d504
Description & Comments:
'fossil rm file' crashes:
(gdb) where
#0  0x91af1e9a in closedir$UNIX2003 ()
#1  0x00002d43 in del_directory_content (zDir=0x202b00 "mdb.mk") at add_.c:223
#2  0x00002de9 in del_cmd () at add_.c:255
#3  0x00022fb7 in main (argc=3, argv=0xbffff49c) at main_.c:258

mdb.mk is a plain file

Suggested patch: --- src/add.c +++ src/add.c @@ -249,11 +249,11 @@ db_begin_transaction(); for(i=2; i<g.argc; i++){ char *zName;

zName = mprintf("%/", g.argv[i]); - if( file_isdir(zName) ){ + if( file_isdir(zName) == 1){ del_directory_content(zName); } else { char *zPath; Blob pathname; file_tree_name(zName, &pathname, 1);

jeremy_c added on 2010-02-13 12:31:25:
Thanks for the patch. It has been applied.