summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
91b0cef)
SCCS-vsn: usr.bin/xsend/xget/xget.c 4.3
-static char sccsid[] = "@(#)xget.c 4.2 %G%";
+static char sccsid[] = "@(#)xget.c 4.3 %G%";
#endif
#include "xmail.h"
#endif
#include "xmail.h"
case 'n':
case 'd':
case '\n':
case 'n':
case 'd':
case '\n':
break;
case '!':
system(buf+1);
break;
case '!':
system(buf+1);
rewind(mf);
if(buf[1] == '\n' || buf[1] == '\0')
strcpy(buf, "s mbox\n");
rewind(mf);
if(buf[1] == '\n' || buf[1] == '\0')
strcpy(buf, "s mbox\n");
- for(p=buf; !isspace(*p); p++);
- for(; isspace(*p); p++);
+ for(p = buf+1; isspace(*p); p++);
p[strlen(p)-1] = 0;
kf = fopen(p, "a");
if(kf == NULL)
{ perror(p);
p[strlen(p)-1] = 0;
kf = fopen(p, "a");
if(kf == NULL)
{ perror(p);
}
decipher(mf, kf);
fclose(mf);
fclose(kf);
unlink(line);
break;
}
decipher(mf, kf);
fclose(mf);
fclose(kf);
unlink(line);
break;
+ default:
+ printf("Commands are:\n");
+ printf("q quit, leaving unread messages\n");
+ printf("n delete current message and goto next\n");
+ printf("d same as above\n");
+ printf("\\n same as above\n");
+ printf("! execute shell command\n");
+ printf("s save message in the named file or mbox\n");
+ printf("w same as above\n");
+ printf("? prints this list\n");
+ goto cmnd;
strcpy(line, myname);
strcat(line, ".%d");
while ((dbuf = readdir(df)) != NULL)
strcpy(line, myname);
strcat(line, ".%d");
while ((dbuf = readdir(df)) != NULL)
- { if(sscanf(dbuf->d_name, line, &i) != 1)
+ {
+ if(sscanf(dbuf->d_name, line, &i) != 1)
continue;
if(fcnt >= MXF)
break;
continue;
if(fcnt >= MXF)
break;