that errors get sent via reply(), while causing some match
failures to match to simply return $1, so the higher level can
deal. Previously, some failures would cause synch problems since
NULL would be returned and no reply was sent.
[pullup from 1.2.3]
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14059
dc483132-0cff-0310-8789-
dd5450dbe970
+2001-11-30 Tom Yu <tlyu@mit.edu>
+
+ * ftpcmd.y (pathname): Handle returns from ftpglob() better so
+ that errors get sent via reply(), while causing some match
+ failures to match to simply return $1, so the higher level can
+ deal. Previously, some failures would cause synch problems since
+ NULL would be returned and no reply was sent.
+
2001-10-11 Mitchell Berger <mitchb@mit.edu>
* ftpd.M: Remove improper formatting from the .SH NAME section, as it
char **vv;
vv = ftpglob((char *) $1);
- if (vv == NULL || globerr != NULL) {
- reply(550, globerr);
- $$ = NULL;
+ $$ = (vv != NULL) ? *vv : NULL;
+ if ($$ == NULL) {
+ if (globerr == NULL)
+ $$ = $1;
+ else {
+ reply(550, "%s", globerr);
+ free((char *) $1);
+ }
} else
- $$ = *vv;
-
- free((char *) $1);
+ free((char *) $1);
} else
$$ = $1;
}