* ftpcmd.y (pathname): Handle returns from ftpglob() better so
authorTom Yu <tlyu@mit.edu>
Sat, 8 Dec 2001 01:58:07 +0000 (01:58 +0000)
committerTom Yu <tlyu@mit.edu>
Sat, 8 Dec 2001 01:58:07 +0000 (01:58 +0000)
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

src/appl/gssftp/ftpd/ChangeLog
src/appl/gssftp/ftpd/ftpcmd.y

index c02c6804783c12b53674196960696c452b90c6c9..7577d5697b6f588e795f2baa989a911a50cf2b2b 100644 (file)
@@ -1,3 +1,11 @@
+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
index 282697e58395fdb0e4d095eda870da03018ed337..f7f16122a5b2474c8e442c724530b793bd671994 100644 (file)
@@ -811,13 +811,16 @@ pathname: pathstring
                        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;
        }