Commit 46862b79 authored by Jonas Termansen's avatar Jonas Termansen

Fix command line parsing with expr(1) failing if the parameter is 0.

parent 9ee05a5a
......@@ -17,7 +17,7 @@ for argument do
fi
case $argument in
*=?*) parameter=$(expr "X$argument" : '[^=]*=\(.*\)') ;;
*=?*) parameter=$(expr "X$argument" : '[^=]*=\(.*\)' || true) ;;
*=) parameter= ;;
*) parameter=yes ;;
esac
......
#!/bin/sh
# Copyright (c) 2015, 2016 Jonas 'Sortie' Termansen.
# Copyright (c) 2015, 2016, 2017 Jonas 'Sortie' Termansen.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
......@@ -29,7 +29,7 @@ for argument do
continue
fi
case $argument in
*=?*) parameter=$(expr "X$argument" : '[^=]*=\(.*\)') ;;
*=?*) parameter=$(expr "X$argument" : '[^=]*=\(.*\)' || true) ;;
*=) parameter= ;;
*) parameter=yes ;;
esac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment