]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/libkern/strsep.c
xnu-6153.141.1.tar.gz
[apple/xnu.git] / bsd / libkern / strsep.c
index 6e09422543c9258b90143dc7728a73aae8943efd..3c4c13c7e263a1a832d34fd4a708f13a407c421b 100644 (file)
@@ -83,19 +83,21 @@ strsep(char **stringp, const char *delim)
        int c, sc;
        char *tok;
 
        int c, sc;
        char *tok;
 
-       if ((s = *stringp) == NULL)
-               return (NULL);
+       if ((s = *stringp) == NULL) {
+               return NULL;
+       }
        for (tok = s;;) {
                c = *s++;
                spanp = delim;
                do {
                        if ((sc = *spanp++) == c) {
        for (tok = s;;) {
                c = *s++;
                spanp = delim;
                do {
                        if ((sc = *spanp++) == c) {
-                               if (c == 0)
+                               if (c == 0) {
                                        s = NULL;
                                        s = NULL;
-                               else
+                               } else {
                                        s[-1] = 0;
                                        s[-1] = 0;
+                               }
                                *stringp = s;
                                *stringp = s;
-                               return (tok);
+                               return tok;
                        }
                } while (sc != 0);
        }
                        }
                } while (sc != 0);
        }