]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Even better ThisCell support, based on Zephyr discussion.
authorRuss Allbery <rra@debian.org>
Tue, 21 Nov 2006 00:04:33 +0000 (00:04 +0000)
committerRuss Allbery <rra@debian.org>
Tue, 21 Nov 2006 00:04:33 +0000 (00:04 +0000)
src/auth/cellconfig.c

index ccf21936a81d4cdda89e213cc377744c170cc75d..c7877a3f9f84e9050abfed36318405d8d0031bff 100644 (file)
@@ -492,10 +492,12 @@ GetCellUnix(struct afsconf_dir *adir)
     p = strchr(tbuffer, '\n');
     if (p)
        *p = '\0';
-    p = tbuffer + strlen(tbuffer) - 1;
-    while (p > tbuffer && isspace(*p))
-       p--;
-    p[1] = '\0';
+    while (*tbuffer != '\0' && isspace(*tbuffer))
+        tbuffer++;
+    p = tbuffer + 1;
+    while (*p != '\0' && !isspace(*p))
+        p++;
+    *p = '\0';
 
     adir->cellName = strdup(tbuffer);
     return 0;