diff options
author | наб <[email protected]> | 2021-04-06 21:25:53 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-06 12:25:53 -0700 |
commit | 61b50107a58a1da9d86f5f81dc35d039ca629aae (patch) | |
tree | d993ac52cb1f4261e553ad41b5f77ea83a15c267 /cmd/zpool/zpool_main.c | |
parent | ec580225d2b2fb78ea9e12d0b08a185fbb50c7a6 (diff) |
libzutil: zfs_isnumber(): return false if input empty
zpool list, which is the only user, would mistakenly try to parse the
empty string as the interval in this case:
$ zpool list "a"
cannot open 'a': no such pool
$ zpool list ""
interval cannot be zero
usage: <usage string follows>
which is now symmetric with zpool get:
$ zpool list ""
cannot open '': name must begin with a letter
Avoid breaking the "interval cannot be zero" string.
There simply isn't a need for this, and it's user-facing.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #11841
Closes #11843
Diffstat (limited to 'cmd/zpool/zpool_main.c')
-rw-r--r-- | cmd/zpool/zpool_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 7a15c78d1..81bbf1375 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -4965,8 +4965,8 @@ get_interval_count(int *argcp, char **argv, float *iv, if (*end == '\0' && errno == 0) { if (interval == 0) { - (void) fprintf(stderr, gettext("interval " - "cannot be zero\n")); + (void) fprintf(stderr, gettext( + "interval cannot be zero\n")); usage(B_FALSE); } /* @@ -4996,8 +4996,8 @@ get_interval_count(int *argcp, char **argv, float *iv, if (*end == '\0' && errno == 0) { if (interval == 0) { - (void) fprintf(stderr, gettext("interval " - "cannot be zero\n")); + (void) fprintf(stderr, gettext( + "interval cannot be zero\n")); usage(B_FALSE); } |