summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-07-27 00:51:44 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-07-27 00:51:44 -0600
commit9b47c3246b85a2be61929a1032e31c4b9c53ef82 (patch)
treee02bba9ef3b26b447420dda853b9fc2bca9bae55 /src
parentf8c99ba3964d156b0a44d6e44cb6306741ae3347 (diff)
librefetch: prevent readlink from thinking the filename is a flag
Diffstat (limited to 'src')
-rwxr-xr-xsrc/librefetch/librefetch6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch
index 02c74ea..e039e12 100755
--- a/src/librefetch/librefetch
+++ b/src/librefetch/librefetch
@@ -124,11 +124,11 @@ main() {
case ${#extra_opts[@]} in
1)
src="${extra_opts[0]#*://}"
- dst="$(readlink -m "${src##*/}")"
+ dst="$(readlink -m -- "${src##*/}")"
;;
2)
src="${extra_opts[0]#*://}"
- dst="$(readlink -m "${extra_opts[1]}")"
+ dst="$(readlink -m -- "${extra_opts[1]}")"
;;
*)
print "%s: %d non-flag arguments found, expected 1 or 2: %s" "$cmd" ${#extra_opts[@]} >> /dev/stderr
@@ -189,7 +189,7 @@ parse_options() {
-C) mode=create;;
-D) mode=download;;
-g|--geninteg) mode=checksums;;
- -p) BUILDFILE="$(readlink -m "$opt")";;
+ -p) BUILDFILE="$(readlink -m -- "$opt")";;
-V|--version) mode=version;;
-h|--help) mode=help;;
-*)