diff options
author | Petr Vorel <pvorel@suse.cz> | 2019-03-27 16:36:26 +0100 |
---|---|---|
committer | Petr Vorel <pvorel@suse.cz> | 2019-04-04 16:24:45 +0200 |
commit | 0bb01e67b3ba079f8f069a99422d783fe6da4287 (patch) | |
tree | d63eb0ebdeffe5d018440429c8f3c2ea856d36c1 /testcases/lib | |
parent | 969e6f3e5ebe541d343568fac52beff9a839e275 (diff) |
shell: Fix handling default parameters in tst_mkfs()
fixes regression when testing df01.sh
Dash does not like shifting more than possible:
/opt/ltp/testcases/bin/df01.sh: 291: shift: can't shift that many
Fixes: 465faf47f ("shell: Use $TST_FS_TYPE and $TST_DEVICE in tst_mkfs()")
Reported-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Diffstat (limited to 'testcases/lib')
-rw-r--r-- | testcases/lib/tst_test.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index af16ce1cf..512732315 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -288,7 +288,8 @@ tst_mkfs() { local fs_type=${1:-$TST_FS_TYPE} local device=${2:-$TST_DEVICE} - shift 2 + [ $# -ge 1 ] && shift + [ $# -ge 1 ] && shift local fs_opts="$@" if [ -z "$fs_type" ]; then |