diff --git a/uusplt.c b/uusplt.c new file mode 100644 index 0000000..f4677e2 --- /dev/null +++ b/uusplt.c @@ -0,0 +1,52 @@ +/* uusplt.c - Split concatenated uuencoded files into separate uue files */ +/* $Id: uusplt.c,v 1.1 1995/02/01 23:57:08 tundra Exp $ */ + +#include +#include +void begun(); + +main() + +{ + + char buf[1001]; + + while(fgets(buf, 1000, stdin) != NULL) + { + if (strncmp("begin",buf, 5) == 0) + begun(buf); + } +} + +void begun(buf) +char *buf; + +{ + FILE *fd; + char nm[101]; + int l; + + l = strlen(buf) - 2; + + while(buf[l] != ' ') + l--; + strcpy(nm, buf+l+1); + l = strlen(nm); + nm[l-1] = '\0'; + strcat(nm, ".uue"); + + if ((fd = fopen(nm, "w")) == NULL) + { + printf("Hosed File Open For %s!", nm); + exit(); + } + + while(strncmp("end", buf, 3) != 0) + { + fputs(buf, fd); + fgets(buf, 1000, stdin); + } + fputs(buf,fd); + fclose(fd); + +}