… | |
… | |
55 | #else |
55 | #else |
56 | #define SEEK_SET 0 |
56 | #define SEEK_SET 0 |
57 | #endif |
57 | #endif |
58 | #endif |
58 | #endif |
59 | |
59 | |
60 | char * uuencode_id = "$Id: uuencode.c,v 1.7 2020/02/09 15:06:43 root Exp $"; |
60 | char * uuencode_id = "$Id: uuencode.c,v 1.8 2020/02/27 06:14:29 root Exp $"; |
61 | |
61 | |
62 | #if 0 |
62 | #if 0 |
63 | /* |
63 | /* |
64 | * the End-Of-Line string. MIME enforces CRLF, so that's what we use. Some |
64 | * the End-Of-Line string. MIME enforces CRLF, so that's what we use. Some |
65 | * implementations of uudecode will complain about a missing end line, since |
65 | * implementations of uudecode will complain about a missing end line, since |
… | |
… | |
422 | return UURET_IOERR; |
422 | return UURET_IOERR; |
423 | } |
423 | } |
424 | } |
424 | } |
425 | |
425 | |
426 | if (pcrc) |
426 | if (pcrc) |
427 | *pcrc = crc32(*pcrc, itemp, count); |
427 | *pcrc = uu_crc32(*pcrc, itemp, count); |
428 | if (crc) |
428 | if (crc) |
429 | *crc = crc32(*crc, itemp, count); |
429 | *crc = uu_crc32(*crc, itemp, count); |
430 | |
430 | |
431 | line++; |
431 | line++; |
432 | |
432 | |
433 | /* |
433 | /* |
434 | * Busy Callback |
434 | * Busy Callback |
… | |
… | |
719 | (themode) ? themode : 0644, |
719 | (themode) ? themode : 0644, |
720 | UUFNameFilter ((outfname)?outfname:infname), |
720 | UUFNameFilter ((outfname)?outfname:infname), |
721 | eolstring); |
721 | eolstring); |
722 | } |
722 | } |
723 | else if (encoding == YENC_ENCODED) { |
723 | else if (encoding == YENC_ENCODED) { |
724 | crc = crc32(0L, Z_NULL, 0); |
724 | crc = CRC32_INIT; |
725 | crcptr = &crc; |
725 | crcptr = &crc; |
726 | if (progress.fsize == -1) { |
726 | if (progress.fsize == -1) { |
727 | fprintf (outfile, "=ybegin line=128 name=%s%s", |
727 | fprintf (outfile, "=ybegin line=128 name=%s%s", |
728 | UUFNameFilter ((outfname)?outfname:infname), |
728 | UUFNameFilter ((outfname)?outfname:infname), |
729 | eolstring); |
729 | eolstring); |
… | |
… | |
912 | (themode) ? themode : ((filemode)?filemode:0644), |
912 | (themode) ? themode : ((filemode)?filemode:0644), |
913 | UUFNameFilter ((outfname)?outfname:infname), eolstring); |
913 | UUFNameFilter ((outfname)?outfname:infname), eolstring); |
914 | } |
914 | } |
915 | } |
915 | } |
916 | if (encoding == YENC_ENCODED) { |
916 | if (encoding == YENC_ENCODED) { |
917 | pcrc = crc32(0L, Z_NULL, 0); |
917 | pcrc = CRC32_INIT; |
918 | pcrcptr = &pcrc; |
918 | pcrcptr = &pcrc; |
919 | if (numparts != 1) { |
919 | if (numparts != 1) { |
920 | if (progress.totsize == -1) { |
920 | if (progress.totsize == -1) { |
921 | fprintf (outfile, "=ybegin part=%d line=128 name=%s%s", |
921 | fprintf (outfile, "=ybegin part=%d line=128 name=%s%s", |
922 | partno, |
922 | partno, |
… | |
… | |
1116 | (themode) ? themode : 0644, |
1116 | (themode) ? themode : 0644, |
1117 | UUFNameFilter ((outfname)?outfname:infname), |
1117 | UUFNameFilter ((outfname)?outfname:infname), |
1118 | eolstring); |
1118 | eolstring); |
1119 | } |
1119 | } |
1120 | else if (encoding == YENC_ENCODED) { |
1120 | else if (encoding == YENC_ENCODED) { |
1121 | crc = crc32(0L, Z_NULL, 0); |
1121 | crc = CRC32_INIT; |
1122 | crcptr = &crc; |
1122 | crcptr = &crc; |
1123 | if (progress.fsize == -1) { |
1123 | if (progress.fsize == -1) { |
1124 | fprintf (outfile, "=ybegin line=128 name=%s%s", |
1124 | fprintf (outfile, "=ybegin line=128 name=%s%s", |
1125 | UUFNameFilter ((outfname)?outfname:infname), |
1125 | UUFNameFilter ((outfname)?outfname:infname), |
1126 | eolstring); |
1126 | eolstring); |
… | |
… | |
1385 | UUFNameFilter ((outfname)?outfname:infname), |
1385 | UUFNameFilter ((outfname)?outfname:infname), |
1386 | eolstring); |
1386 | eolstring); |
1387 | } |
1387 | } |
1388 | else if (encoding == YENC_ENCODED) { |
1388 | else if (encoding == YENC_ENCODED) { |
1389 | if (!crcptr) { |
1389 | if (!crcptr) { |
1390 | crc = crc32(0L, Z_NULL, 0); |
1390 | crc = CRC32_INIT; |
1391 | crcptr = &crc; |
1391 | crcptr = &crc; |
1392 | } |
1392 | } |
1393 | pcrc = crc32(0L, Z_NULL, 0); |
1393 | pcrc = CRC32_INIT; |
1394 | pcrcptr = &pcrc; |
1394 | pcrcptr = &pcrc; |
1395 | if (numparts != 1) { |
1395 | if (numparts != 1) { |
1396 | if (progress.totsize == -1) { |
1396 | if (progress.totsize == -1) { |
1397 | fprintf (outfile, "=ybegin part=%d line=128 name=%s%s", |
1397 | fprintf (outfile, "=ybegin part=%d line=128 name=%s%s", |
1398 | part, |
1398 | part, |
… | |
… | |
1727 | } |
1727 | } |
1728 | |
1728 | |
1729 | |
1729 | |
1730 | if (encoding == YENC_ENCODED) { |
1730 | if (encoding == YENC_ENCODED) { |
1731 | if (partno == 1) |
1731 | if (partno == 1) |
1732 | crc = crc32(0L, Z_NULL, 0); |
1732 | crc = CRC32_INIT; |
1733 | crcptr = &crc; |
1733 | crcptr = &crc; |
1734 | if (subject) |
1734 | if (subject) |
1735 | sprintf (subline, "- %s - %s (%03d/%03d)", oname, subject, |
1735 | sprintf (subline, "- %s - %s (%03d/%03d)", oname, subject, |
1736 | partno, numparts); |
1736 | partno, numparts); |
1737 | else |
1737 | else |