(retrieve): file must exist to apply a command to it.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1771 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-05-25 13:49:00 +00:00
parent 6d38183c86
commit 3d638b4de6

View File

@@ -946,14 +946,16 @@ retrieve(char *cmd, char *name)
struct cmds *p;
for(p = cmds; p->ext; p++){
char *tail = name + strlen(name) - strlen(p->ext);
char c = *tail;
if(strcmp(tail, p->ext) == 0){
char c = *tail;
*tail = 0;
if(strcmp(tail, p->ext) == 0 &&
(*tail = 0) == 0 &&
access(name, R_OK) == 0){
snprintf (line, sizeof(line), p->cmd, name);
*tail = c;
break;
}
*tail = c;
}
if(p->ext){
fin = ftpd_popen(line, "r", 0, 0);