Skip to content

Commit 4ad5197

Browse files
crater2150lukrop
authored andcommitted
Do not prepend working directory, if path is already absolute
1 parent f904f80 commit 4ad5197

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

file.bash

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ cmd_store() {
2020
local passfile="$PREFIX/$path.gpg"
2121

2222
cd $OLDPWD # fix for relative paths
23-
local file_abs_path="$OLDPWD/$file"
23+
case "$file" in
24+
/*) local file_abs_path="$file";;
25+
*) local file_abs_path="$OLDPWD/$file";;
26+
esac
2427

2528
check_sneaky_paths "$1"
2629
set_git "$passfile"

0 commit comments

Comments
 (0)