afscp: null-terminate root.cell dir if needed in dynroot mode
authorDerrick Brashear <shadow@your-file-system.com>
Thu, 7 Mar 2013 11:53:16 +0000 (06:53 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Tue, 12 Mar 2013 13:34:49 +0000 (06:34 -0700)
instead of doing a check for something which will never be true,
and then terminating, just terminate if it's not already
null-terminated.

Change-Id: I8ad18800de22c8d10eb27fbcb2fffb2b3a5a9127
Reviewed-on: http://gerrit.openafs.org/9439
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chaskiel Grundman <cg2v@andrew.cmu.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/libafscp/afscp_dir.c

index f5470f5..3a24a4b 100644 (file)
@@ -370,11 +370,8 @@ gettoproot(struct afscp_cell *cell, char *p, char **q,
            r = p;
            while (*r && *r != '/')
                r++;
-           if (!*r && !*p) {
-               afscp_errno = ENODEV;
-               return 1;
-           }
-           *r++ = 0;
+           if (*r)
+               *r++ = 0;
            *q = r;
            afs_dprintf(("gettoproot: dynroot looking up cell %s\n", p));
            cell = afscp_CellByName(p, NULL);