Re: Building sharutils 4.13.4 with MinGW
Bruce Korb <[email protected]>
| Newsgroups | gmane.comp.gnu.utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
On 04/08/13 19:57, Eli Zaretskii wrote:
> I would suggest
>
> Specifying the compactor "@samp{none}" will disable file compression.
> Compression forces uuencoding of compressed files, and the recipient
> must have @command{uudecode} to unpack the archive. (Compressed files
> are never processed as plain text.)
Better still.
>> OK, I think _my_ eyeballs jumped. Sorry. I think this is adequate for this use here,
>> but should probably be derived from another variation on the quoting style names:
>
> But then you'd need to pass yet another argument to that function.
Actually, no. The unadorned name is passed in already and double quote
adornment is only needed in this one place. I am actually saying the
gnulib module needs a new quoting style that would be used here.
In the end, I separated the "wc -c" string for the system() call
from the "wc -c" string for the shar script and wound up with:
> #ifndef __MINGW32__
> static char const cct_cmd[] = "LC_ALL=C wc -c < %s";
> char *command = alloca (sizeof(cct_cmd) + strlen (quoted_name) + 2);
> #else
> static char const cct_cmd[] = "set LC_ALL=C & wc -c \"%s\"";
> char *command = alloca (sizeof(cct_cmd) + strlen (local_name));
> #endif
>
> sprintf (command, cct_cmd, quoted_name);
and used a different formatting string to emit the shar text.
>> {
>> static char ftime_fmt[] = "%Y-%m-%d %H:%M %Z";
...
> ftime_fmt is a static variable. Doesn't replacing a character in it
> make that change permanent for all the following uses? Or are you
> sure this array will never be used more than once in the same run?
It is used multiple times. What is the likelihood that the first time
through it fails, but works with "%z" and the next time through it
would have worked with "%Z"? Then there's the consistency thing.
I think changing it to 'z' is fine as a do it once and leave it.
There's still the chance "%Z" works and then doesn't, but I'm not
going to worry over it. :) Once flipped, it stays flipped.
Thanks for reviewing this stuff. I'm leaving for a conference all
next week, so I won't actually polish this and bump out the next
rev until May.
Regards, Bruce