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 08:52, Eli Zaretskii wrote:
> I think I found another bug: the -T option doesn't seem to work.
[...]
> To fix that, I modified the condition to also include an explicit
> MIXED_UUENCODE option:
>
>    if (! HAVE_OPT(COMPACTOR) && ! HAVE_OPT(MIXED_UUENCODE))
>      SET_OPT_MIXED_UUENCODE;

In the end, that code isn't even needed.  If no mixed-uuencode
option has been specified, then the default is "mixed" anyway.
The state of WHICH_OPT_MIXED_UUENCODE detects any of the four
states ("0" being the default/unspecified state):

 >   switch (WHICH_OPT_MIXED_UUENCODE) {
 >   case VALUE_OPT_TEXT_FILES: return 0;
 >   case VALUE_OPT_UUENCODE:   return 1;
 >   case VALUE_OPT_MIXED_UUENCODE:
 >   default: break;  }

 > As an aside, I found the documentation of the "-C none" option
 > confusing.  The docs seem to imply that "-C none" will _also_ have the
 > effect of preventing uuencode of non-text files (note the second
 > sentence):

I'll have to fix the doc.  It inhibits compression only.
It says nothing about the decision to encode.  The default
is mixed

 >    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."
says only that if you compress, then you uuencode.  If you compress all files,
then you uuencode all files, too.  How's this:

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

Immediately above the switch statement above is this code:

>   if (cmpr_state != NULL)
>     return 1; // compression always implies encoding

 > I hope it will be possible to make this part of the docs less
 > confusing.

Suggestions welcome :)

BTW,:
> +  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:

> enum quoting_style const quoting_style_vals[] =
> {
>   literal_quoting_style,
>   shell_quoting_style,
>   shell_always_quoting_style,
>   c_quoting_style,
>   c_maybe_quoting_style,
>   escape_quoting_style,
>   locale_quoting_style,
>   clocale_quoting_style
> };

I was using "shell_quoting_style" and we need "windows_cmd_quoting_style".

On 04/08/13 10:23, Eli Zaretskii wrote:
 > It might be a good alternative to fall back on %z, which has a
 > predictable fixed limit, if %Z fails.

Done:

   {
     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));
     }
   }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.