bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Building sharutils 4.13.4 with MinGW


From: Eli Zaretskii
Subject: Re: Building sharutils 4.13.4 with MinGW
Date: Tue, 09 Apr 2013 05:57:00 +0300

> Date: Mon, 08 Apr 2013 14:09:49 -0700
> From: Bruce Korb <address@hidden>
> CC: address@hidden
> 
>  >    Specifying  the compactor "none" will then disable file compres-
>  >    sion, even for non-text files.  Any other compactor  will  force
>  >    uuencoding  of  files,  and  the recipient must have uudecode to
>  >    unpack the archive.  (Compressed files are  never  processed  as
>  >    plain text.)
> 
> The operative phrase here is "Compressed files are never processed as plain 
> text."

IMO, it's not a good idea to have the operative phrase in parentheses ;-)

> >     Specifying the compactor "@samp{none}" will disable file compression.
> >     Any other compactor will force uuencoding of files, and the recipient
> >     must have @command{uudecode} to unpack the archive.  (Compressed files
> >     are never processed as plain text.)

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.)

> Immediately above the switch statement above is this code:
> 
> >   if (cmpr_state != NULL)
> >     return 1; // compression always implies encoding

Yes, that's how I understood what was going on.

> > +  char *command = alloca (sizeof(local_cmd) + strlen (local_name) + 2);
> > +  sprintf (command, "%s \"%s\"", local_cmd, local_name);
> 
> 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.  It
currently gets the file with and without quoting.  Now you will need a
3rd argument, quoted as appropriate for local commands.  That's
doable, of course.

>    {
>      static char ftime_fmt[] = "%Y-%m-%d %H:%M %Z";
> 
>      /*
>       * All fields are two characters, except %Y is four and
>       * %Z may be up to 30 (?!?!).  Anyway, if that still fails,
>       * we'll drop back to "%z".  We'll give up if that fails.
>       */
>      char buffer[sizeof (ftime_fmt) + 64];
>      time_t now;
>      struct tm * local_time;
>      time (&now);
>      local_time = localtime (&now);
>      {
>        size_t l =
>          strftime (buffer, sizeof (buffer) - 1, ftime_fmt, local_time);
>        if (l == 0)
>          {
>            ftime_fmt[sizeof(ftime_fmt) - 2] = 'z';
>            l = strftime (buffer, sizeof (buffer) - 1, ftime_fmt, local_time);
>          }
>        if (l > 0)
>          fprintf (fp, made_on_comment_z, buffer, OPT_ARG(SUBMITTER));
>      }
>    }

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?



reply via email to

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