aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-09-07 14:42:51 -0500
committerRob Landley <rob@landley.net>2014-09-07 14:42:51 -0500
commit25fe0e0bea85f1d851ce03a90c0f1bf41ab431f2 (patch)
tree23e86748cd6ee879249afde61ab50edd27d6325d /lib
parent980458f62748d273a006da3ddcd2b619d44598ce (diff)
downloadtoybox-25fe0e0bea85f1d851ce03a90c0f1bf41ab431f2.tar.gz
Debugging pass on mount. Not quite done yet, but the basics seem to work now.
Diffstat (limited to 'lib')
-rw-r--r--lib/getmountlist.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/getmountlist.c b/lib/getmountlist.c
index a88a7b90..98347223 100644
--- a/lib/getmountlist.c
+++ b/lib/getmountlist.c
@@ -31,7 +31,7 @@ char *comma_iterate(char **list, int *len)
{
char *start = *list, *end;
- if (!*list) return 0;
+ if (!*list || !**list) return 0;
if (!(end = strchr(*list, ','))) {
*len = strlen(*list);
@@ -76,8 +76,10 @@ int comma_scan(char *optlist, char *opt, int clean)
if (!s) break;
no = 2*(*s == 'n' && s[1] == 'o');
- if (optlen == len+no && !strcmp(opt, s+no)) got = !no;
- if (clean) memmove(s, optlist, strlen(optlist)+1);
+ if (optlen == len+no && !strcmp(opt, s+no)) {
+ got = !no;
+ if (clean) memmove(s, optlist, strlen(optlist)+1);
+ }
}
return got;