bug-gnulib
[Top][All Lists]
Advanced

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

Re: tmpdir.c:path_search() v. VMS


From: Steven M. Schweda
Subject: Re: tmpdir.c:path_search() v. VMS
Date: Mon, 15 Jul 2013 15:10:33 -0500 (CDT)

From: Paul Eggert <address@hidden>

> Thanks for the heads up.  I pushed this but have not tested
> under VMS, so please give it a try.
> [...]
+  sprintf (tmpl + dlen, &"/%.*sXXXXXX"[!add_slash], pfx, (int) plen);
> [...]

   Around here, I get fewer %SYSTEM-F-ACCVIO run-time complaints if I
reorder the arguments:

  sprintf (tmpl + dlen, &"/%.*sXXXXXX"[!add_slash], plen, pfx);

(No need for the "(int)" type cast around here, either.)

   Call me old-fashioned, but if I were writing code which does integer
arithmetic with a variable ("dlen + add_slash + plen + 6 + 1"), then I'd
probably declare it as "int" rather than "bool", especially if the code
works only if "true" is one, "false" is zero, and "!" doesn't mess that
up.  Adding the false-true abstraction that way to hide what must really
be 0 and 1 doesn't help me to understand what "[!add_slash]" is doing,
compared with, say, "[first_char]" or "[1 - use_slash]" (or almost
anything else).

   But, with the right things associated with "*" and "s", it does seem
to work (whether or not I like the style).  Thanks.  I'll let the Wget
folks know that a change is in the pipeline.

------------------------------------------------------------------------

   Steven M. Schweda               address@hidden
   382 South Warwick Street        (+1) 651-699-9818
   Saint Paul  MN  55105-2547



reply via email to

[Prev in Thread] Current Thread [Next in Thread]