On 24 May 2004, [EMAIL PROTECTED] wrote:
> 
> On 24 May 2004, [EMAIL PROTECTED] wrote:
>> 
>> In the latest changeset, several file had newlines removed when
>> using the "g_warning()" function.  The latest changes to sockets.c
>> removed the "show_error()" function.  All of the changes kept the
>> newline characters in the string data.  For example,
>> 
>> [Sockets.c 1.115: line 1585]
>> -            g_warning("Short reply from SOCKS server\n");
>> +            g_warning("Short reply from SOCKS server");
>> 
> 
> If that analysis is correct, then the same thing applies to
> routing.c.

To beat a dead horse,

[props.c 1.39: line 1357]
-       static const char fmt[] = "Bad line %u in config file, ignored\n";
+       static const char fmt[] = "Bad line %u in config file, ignored";

Also, I think this line can be changed,

[props.c 1.39: line 1394]
-               while ((c = (guchar) *s) != '\0' && isascii(c) && isblank(c))
+               while ((c = (guchar) *s) != '\0' && isblank(c))
                        s++;

If c is "blank", it is also ascii?  Isn't that right?  I don't think
there are UTF type blanks.

[props.c 1.39: line 1397]
-               if (!isascii(c) || !isalpha(c))
+               if (!isascii(c) && !isalpha(c))
                        continue;

Here, I think we keep parsing if it is alpha or ascii?  So the
condition we want to continue is "isascii(c) || isalpha(c)".  Using
demorgans law [afaik], "!(!isascii(c) && !isalpha(c))", so the
complement would be "!isascii(c) && !isalpha(c)".  I think this is
meant to handle UTF characters?  Normally the isascii() would be
redundant like the above.  Maybe the condition should only be "if
(!isalpha(c))".  Hmm, maybe it is right; "we keep parsing if it is
alpha *AND* ascii", disallowing UTF alpha characters?

[props.c 1.39: line 1402]
-               if (c != '=' && !(isascii(c) && isblank(c))) {
+               if (!(c == '=' || isblank(c))) {

Hmmm.  I am not certain if "isascii(c)" is meant to prevent UTF (ie,
high code page characters).  So maybe I will just stop with this line
of thought.  Maybe a comment with a regular expression to define what
the config lines are suppose to be like would help?

Fwiw,
Bill Pringlemeir.






-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Gtk-gnutella-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to