(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:
@@ -946,14 +946,16 @@ retrieve(char *cmd, char *name)
|
|||||||
struct cmds *p;
|
struct cmds *p;
|
||||||
for(p = cmds; p->ext; p++){
|
for(p = cmds; p->ext; p++){
|
||||||
char *tail = name + strlen(name) - strlen(p->ext);
|
char *tail = name + strlen(name) - strlen(p->ext);
|
||||||
|
char c = *tail;
|
||||||
|
|
||||||
if(strcmp(tail, p->ext) == 0){
|
if(strcmp(tail, p->ext) == 0 &&
|
||||||
char c = *tail;
|
(*tail = 0) == 0 &&
|
||||||
*tail = 0;
|
access(name, R_OK) == 0){
|
||||||
snprintf (line, sizeof(line), p->cmd, name);
|
snprintf (line, sizeof(line), p->cmd, name);
|
||||||
*tail = c;
|
*tail = c;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*tail = c;
|
||||||
}
|
}
|
||||||
if(p->ext){
|
if(p->ext){
|
||||||
fin = ftpd_popen(line, "r", 0, 0);
|
fin = ftpd_popen(line, "r", 0, 0);
|
||||||
|
Reference in New Issue
Block a user