Re: [PATCH] Fix GnomeVFS LS parser



Am Mittwoch, den 19.10.2005, 10:20 +0200 schrieb Alexander Larsson:
> On Tue, 2005-10-18 at 17:03 +0200, Christian Neumair wrote:
> > Am Dienstag, den 18.10.2005, 10:01 +0200 schrieb Alexander Larsson:
> > > On Mon, 2005-10-17 at 19:26 +0200, Christian Neumair wrote:
> > > > Am Montag, den 17.10.2005, 16:18 +0200 schrieb Alexander Larsson:
> > > > > On Fri, 2005-10-14 at 22:51 +0200, Christian Neumair wrote:
> > > > > > OK, the GnomeVFS ls -lga parser is seriously hosed by only handling one
> > > > > > filename at a time, but that's a different topic.
> > > > > > The attached patch fixes bug 163671 [1]. It makes GnomeVFS pass all
> > > > > > "test-parse-ls-lga" tests, and even display files named like a time or
> > > > > > like a year correctly in FTP directories, which was a bit tricky, since
> > > > > > the FTP module didn't split the string at '\n' characters before passing
> > > > > > it to the parser. However, since the API suggests that
> > > > > > gnome_vfs_parse_ls_lga can parse multiple lines ([2]), I've preferred to
> > > > > > add multiline detection semantics to the latter.
> > > > > > 
> > > > > > [1] http://bugzilla.gnome.org/show_bug.cgi?id=163671
> > > > > > [2] which is - I repeat - NOT true as of writing, it only sets the first
> > > > > > member of the passed-in filename array
> > > > > 
> > > > > I'm not sure why you think the filename argument is an array. Its just a
> > > > > normal out-parameter.
> > > > 
> > > > Ouch, sorry. Please ignore my stupid comment.
> > > > 
> > > > > Furthermore, it looks like this is not a full patch. vfs_parse_filedate
> > > > > adds more arguments, but the calls to it are not changed.
> > > > 
> > > > That was removed by accident.
> > > 
> > > I'm not sure I understand the newline checks in is_last_column. Is that
> > > really required?
> > 
> > We seem to convert the incoming char * into a char * array by adding a
> > new array element to the columns array whenever a space, a carriage
> > return or a newline character is reached in vfs_split_text. Therefore,
> > none of the columns array members contains any of these character, and
> > the information whether we split on a line-break or on a space is lost.
> 
> So, the ls text feed into this function is never linewrapped? I'm not
> sure how e.g. the ftp protocol works. Does it send really wide ls lines
> if the filename is long?

Yes, it passes multiple lines at once. Maybe we should add proper
documentation to the ls parser, only parse the first line, only pass the
part before '\r' and '\n' in the FTP module, and remove the second part
of is_last_column? However, I was told that '\n' and '\r' may legally
occur in filenames. Odd enough to ignore? Or should we pass the whole
multiline string, and try to vfs_parse_filetype and vfs_parse_filemode
the string after the first newline?

-- 
Christian Neumair <chris gnome-de org>

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



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