Test failures in sharutils-4.13.3

Peter Fales <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <[email protected]>
I'm getting corrupt output from sharutils when the -L  option is used.

If gotten as far determing that SPLIT_SIZE_LIMIT is marked as 
unused when it reaches line 970 in shar.c, so archive_type_position
is not set on line 980.  

970   if (HAVE_OPT(SPLIT_SIZE_LIMIT))
971     {
972       int len = snprintf (explain_text_fmt, sizeof (explain_text_fmt),
973                           explain_fmt_fmt, explain_1_len, explain_2_len);
974       if ((unsigned)len >= sizeof (explain_text_fmt))
975         strcpy (explain_text_fmt, "#%-256s\n#%-256s\n");
976 
977       /* May be split, provide for white space for an explanation.  */
978 
979       fputs ("#\n", output);
980       archive_type_position = ftell (output);
981       fprintf (output, explain_text_fmt, "", "");
982     }

When it later hits line 1385, it seeks to position 0 and clobbers the
first part of the file.


1381  if (part_number == 1)
1382    {
1383      /* Rewrite the info lines on the first header.  */
1384
1385      fseek (output, archive_type_position, SEEK_SET);
1386      fprintf (output, explain_text_fmt, explain_1, explain_2);
1387    }

I don't understand the option parsing code well enough to understand
why the test on line 970 is failing.


-- 
Peter Fales
Alcatel-Lucent
Member of Technical Staff
1960 Lucent Lane
Room: 9H-505
Naperville, IL 60566-7033
Email: [email protected]
Phone: 630 979 8031
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.