vfs bug



Hello,

I just found a bug in mc vfs code. It appears when parsing ftp listing containing files such "2000 bla-bla".
(Yes, i know, spaces are bad).
The bug is that vfs_parse_filedate tries to interprete first word of file ("2000") as year. I suggest this patch, but not sure, please fix me if i wrong (made against today cvs version)

diff -ru3 mc-4.5.55/vfs/vfs.c mc-4.5.55.new/vfs/vfs.c
--- mc-4.5.55/vfs/vfs.c Sun Aug 19 20:11:39 2001
+++ mc-4.5.55.new/vfs/vfs.c     Sat Aug 10 21:12:05 2002
@@ -1592,8 +1592,8 @@
           idx++;

       /* This is a special case for ctime() or Mon DD YYYY hh:mm */
-       if(is_num (idx) && (columns[idx+1][0]) &&
- ((got_year |= is_year(columns[idx], &tim)) || is_time(columns[idx], &tim)))
+       if(is_num (idx) && (columns[idx+1][0]) && !got_year &&
+           is_time(columns[idx], &tim))
               idx++; /* time & year or reverse */
       } /* only time or date */
    }





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]