… | |
… | |
55 | #include <uudeview.h> |
55 | #include <uudeview.h> |
56 | #include <uuint.h> |
56 | #include <uuint.h> |
57 | #include <fptools.h> |
57 | #include <fptools.h> |
58 | #include <uustring.h> |
58 | #include <uustring.h> |
59 | |
59 | |
60 | char * uuscan_id = "$Id: uuscan.c,v 1.7 2003/11/06 13:33:41 root Exp $"; |
60 | char * uuscan_id = "$Id: uuscan.c,v 1.8 2004/02/01 18:50:00 root Exp $"; |
61 | |
61 | |
62 | /* |
62 | /* |
63 | * Header fields we recognize as such. See RFC822. We add "From ", |
63 | * Header fields we recognize as such. See RFC822. We add "From ", |
64 | * the usual marker for a beginning of a new message, and a couple |
64 | * the usual marker for a beginning of a new message, and a couple |
65 | * of usual MDA, News and MIME headers. |
65 | * of usual MDA, News and MIME headers. |
… | |
… | |
617 | int encoding=0, dflag=0, ctline=42; |
617 | int encoding=0, dflag=0, ctline=42; |
618 | int dontcare=0, hadnl=0; |
618 | int dontcare=0, hadnl=0; |
619 | long preheaders=0, oldposition; |
619 | long preheaders=0, oldposition; |
620 | long yefilesize=0, yepartends=0; |
620 | long yefilesize=0, yepartends=0; |
621 | size_t dcc, bhopc; |
621 | size_t dcc, bhopc; |
622 | |
|
|
623 | blen = 0; preheaders = 0; /* calm down gcc */ |
|
|
624 | |
622 | |
625 | *errcode = UURET_OK; |
623 | *errcode = UURET_OK; |
626 | (void) UUDecodeLine (NULL, NULL, 0); /* init */ |
624 | (void) UUDecodeLine (NULL, NULL, 0); /* init */ |
627 | bhdsp = bhds2; |
625 | bhdsp = bhds2; |
628 | |
626 | |
… | |
… | |
1471 | long preheaders, prevpos=0, preenc, before; |
1469 | long preheaders, prevpos=0, preenc, before; |
1472 | char *line=uuscan_spline; |
1470 | char *line=uuscan_spline; |
1473 | fileread *result; |
1471 | fileread *result; |
1474 | char *ptr1, *ptr2; |
1472 | char *ptr1, *ptr2; |
1475 | |
1473 | |
1476 | blen = 0; prevpos = 0; /* calm down gcc */ |
|
|
1477 | |
|
|
1478 | (void) UUDecodeLine (NULL, NULL, 0); /* init */ |
1474 | (void) UUDecodeLine (NULL, NULL, 0); /* init */ |
1479 | if (datei == NULL || feof (datei)) { |
1475 | if (datei == NULL || feof (datei)) { |
1480 | *errcode = UURET_OK; |
1476 | *errcode = UURET_OK; |
1481 | return NULL; |
1477 | return NULL; |
1482 | } |
1478 | } |
… | |
… | |
1613 | fseek (datei, prevpos, SEEK_SET); |
1609 | fseek (datei, prevpos, SEEK_SET); |
1614 | line[0] = '\0'; |
1610 | line[0] = '\0'; |
1615 | break; |
1611 | break; |
1616 | } |
1612 | } |
1617 | |
1613 | |
1618 | if (_FP_fgets (line, 255, datei) == NULL) |
1614 | if (_FP_fgets (line, 255, datei) == NULL) { |
1619 | break; |
1615 | /* If we are at eof without finding headers, there probably isn't */ |
|
|
1616 | if (hcount < hlcount.afternl) { |
|
|
1617 | fseek (datei, prevpos, SEEK_SET); |
|
|
1618 | line[0] = '\0'; |
|
|
1619 | } |
|
|
1620 | break; |
|
|
1621 | } |
1620 | line[255] = '\0'; |
1622 | line[255] = '\0'; |
1621 | } |
1623 | } |
1622 | |
1624 | |
1623 | /* skip empty lines */ |
1625 | /* skip empty lines */ |
1624 | prevpos = ftell (datei); |
1626 | prevpos = ftell (datei); |