From: Nathan Scott Date: Tue, 20 Sep 2005 15:34:20 +0000 (+0000) Subject: Fix strtok botch which prevented extraction of rtdev name. X-Git-Tag: v2.8.0~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c222c6962b4e87e30fe28f1150a168c847d2798;p=thirdparty%2Fxfsprogs-dev.git Fix strtok botch which prevented extraction of rtdev name. Merge of master-melb:xfs-cmds:23864a by kenmcd. --- diff --git a/libxcmd/paths.c b/libxcmd/paths.c index e25ae9aec..ab0fb9ac6 100644 --- a/libxcmd/paths.c +++ b/libxcmd/paths.c @@ -155,24 +155,18 @@ fs_extract_mount_options( fslog = fsrt = fslogend = fsrtend = NULL; /* Extract log device and realtime device from mount options */ - if ((fslog = hasmntopt(mnt, "logdev="))) { + if ((fslog = hasmntopt(mnt, "logdev="))) fslog += 7; - fslogend = strtok(fslog, " ,"); - } - if ((fsrt = hasmntopt(mnt, "rtdev="))) { + if ((fsrt = hasmntopt(mnt, "rtdev="))) fsrt += 6; - fsrtend = strtok(fsrt, " ,"); - } /* Do this only after we've finished processing mount options */ if (fslog) { - if (fslogend != fslog) - *fslogend = '\0'; /* terminate end of logdev name */ + fslogend = strtok(fslog, " ,"); fslog = strdup(fslog); } if (fsrt) { - if (fsrtend != fsrt) - *fsrtend = '\0'; /* terminate end of rtdev name */ + fsrtend = strtok(fsrt, " ,"); fsrt = strdup(fsrt); }