diff options
| author | Karel Zak <kzak@redhat.com> | 2016-03-15 14:02:19 +0100 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2016-03-15 14:07:34 +0100 |
| commit | 40f00b4f8e50c201647e0adb1d44bf01efbed09f (patch) | |
| tree | dba875d6bf9743892a0a6b5ec4faec3337307614 /lib/strutils.c | |
| parent | 12f5cbe15940bfb94d31a1b898084aa5f0e5fa10 (diff) | |
| download | util-linux-40f00b4f8e50c201647e0adb1d44bf01efbed09f.tar.gz | |
libmount: improve conversion from root= to the devname
Currently the code supports /dev/name or PARTUUID= only. We also
need to support 'maj:min' and 'hexhex' notations.
Reported-by: George Spelvin <linux@horizon.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/strutils.c')
| -rw-r--r-- | lib/strutils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/strutils.c b/lib/strutils.c index 2d7cb59eda..d58b4b468c 100644 --- a/lib/strutils.c +++ b/lib/strutils.c @@ -183,6 +183,15 @@ int isdigit_string(const char *str) return p && p > str && !*p; } +int isxdigit_string(const char *str) +{ + const char *p; + + for (p = str; p && *p && isxdigit((unsigned char) *p); p++); + + return p && p > str && !*p; +} + /* * parse_switch(argv[i], "on", "off", "yes", "no", NULL); */ |
