… | |
… | |
53 | #include <uudeview.h> |
53 | #include <uudeview.h> |
54 | #include <uuint.h> |
54 | #include <uuint.h> |
55 | #include <fptools.h> |
55 | #include <fptools.h> |
56 | #include <uustring.h> |
56 | #include <uustring.h> |
57 | |
57 | |
58 | char * uunconc_id = "$Id: uunconc.c,v 1.19 2009/10/13 20:53:49 root Exp $"; |
58 | char * uunconc_id = "$Id: uunconc.c,v 1.20 2010/12/14 21:19:33 root Exp $"; |
59 | |
59 | |
60 | /* for braindead systems */ |
60 | /* for braindead systems */ |
61 | #ifndef SEEK_SET |
61 | #ifndef SEEK_SET |
62 | #ifdef L_BEGIN |
62 | #ifdef L_BEGIN |
63 | #define SEEK_SET L_BEGIN |
63 | #define SEEK_SET L_BEGIN |
… | |
… | |
787 | p2 += 2; |
787 | p2 += 2; |
788 | p1 = p2; |
788 | p1 = p2; |
789 | } |
789 | } |
790 | else if (!*p2) { |
790 | else if (!*p2) { |
791 | /* soft line break */ |
791 | /* soft line break */ |
792 | *p2 = '\0'; |
792 | goto skip_lbr; |
793 | break; |
793 | break; |
794 | } |
794 | } |
795 | else { |
795 | else { |
796 | /* huh? */ |
796 | /* huh? */ |
797 | fputc ('=', dataout); |
797 | fputc ('=', dataout); |
798 | } |
798 | } |
799 | } |
799 | } |
|
|
800 | /* |
|
|
801 | * p2 points to a nullbyte right after the CR/LF/CRLF |
|
|
802 | */ |
|
|
803 | val = 0; |
|
|
804 | while (p2>p1 && isspace (*(p2-1))) { |
|
|
805 | if (*(p2-1) == '\012' || *(p2-1) == '\015') |
|
|
806 | val = 1; |
|
|
807 | p2--; |
|
|
808 | } |
|
|
809 | *p2 = '\0'; |
800 | |
810 | |
801 | /* |
811 | /* |
802 | * If the part ends directly after this line, the data does not end |
812 | * If the part ends directly after this line, the data does not end |
803 | * with a linebreak. Or, as the docs put it, "the CRLF preceding the |
813 | * with a linebreak. Or, as the docs put it, "the CRLF preceding the |
804 | * encapsulation line is conceptually attached to the boundary. |
814 | * encapsulation line is conceptually attached to the boundary. |
… | |
… | |
809 | (ftell(datain)<maxpos || flags&FL_TOEND || |
819 | (ftell(datain)<maxpos || flags&FL_TOEND || |
810 | (!(flags&FL_PROPER) && uu_fast_scanning))) |
820 | (!(flags&FL_PROPER) && uu_fast_scanning))) |
811 | fprintf (dataout, "%s\n", p1); |
821 | fprintf (dataout, "%s\n", p1); |
812 | else |
822 | else |
813 | fprintf (dataout, "%s", p1); |
823 | fprintf (dataout, "%s", p1); |
|
|
824 | |
|
|
825 | skip_lbr: ; |
814 | } |
826 | } |
815 | return UURET_OK; |
827 | return UURET_OK; |
816 | } |
828 | } |
817 | |
829 | |
818 | /* |
830 | /* |