[FFmpeg-cvslog] r15366 - trunk/ffmpeg.c

Michael Niedermayer michaelni
Fri Sep 19 01:30:38 CEST 2008


On Thu, Sep 18, 2008 at 03:00:37PM -0700, Mike Melanson wrote:
> michael wrote:
> > +        if(line[0] == '#' && !e)
> > +            continue;
> 
> So the comment marker can only occur at the start of a line? Still not 
> very good behavior. Expected behavior would be for everything between 
> '#' and the next newline to be disregarded.

-        e|= sscanf(line, "%999[^=]=%999[^\n]\n", tmp, tmp2) - 2;
+        e|= sscanf(line, "%999[^=]=%999[^#\n]", tmp, tmp2) - 2;


> 
> Face it-- text parsers in C are ugly. Good luck trying to make this 
> user-friendly feature pretty enough for the FFmpeg codebase.

Text parsers in C are only ugly when they are written by an idiot.
One can always write whatever primitive building blocks are needed
for a clean parser.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20080919/470ef3e5/attachment.pgp>



More information about the ffmpeg-cvslog mailing list