summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/password-store.sh2
-rw-r--r--src/platform/cygwin.sh25
2 files changed, 26 insertions, 1 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index afdaf39..c9a8f29 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -310,7 +310,7 @@ cmd_show() {
check_sneaky_paths "$path"
if [[ -f $passfile ]]; then
if [[ $clip -eq 0 ]]; then
- exec $GPG -d "${GPG_OPTS[@]}" "$passfile"
+ $GPG -d "${GPG_OPTS[@]}" "$passfile" || exit $?
else
local pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | head -n 1)"
[[ -n $pass ]] || exit 1
diff --git a/src/platform/cygwin.sh b/src/platform/cygwin.sh
index 05c51e0..e0a90c7 100644
--- a/src/platform/cygwin.sh
+++ b/src/platform/cygwin.sh
@@ -14,3 +14,28 @@ clip() {
) 2>/dev/null & disown
echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."
}
+
+# replaces Cygwin-style filenames with their Windows counterparts
+gpg_winpath() {
+ local args=("$@")
+ # as soon as an argument (from back to front) is no file, it can only be a filename argument if it is preceeded by '-o'
+ local could_be_filenames="true"
+ local i
+ for ((i=${#args[@]}-1; i>=0; i--)); do
+ if ( [ $i -gt 0 ] && [ "${args[$i-1]}" = "-o" ] ); then
+ args[$i]=$(cygpath -am ${args[$i]})
+ elif [ $could_be_filenames = "true" ]; then
+ if [ -e ${args[$i]} ]; then
+ args[$i]=$(cygpath -am ${args[$i]})
+ else
+ could_be_filenames="false"
+ fi
+ fi
+ done
+ $GPG_ORIG "${args[@]}"
+}
+
+if $GPG --help | grep -q Gpg4win; then
+ GPG_ORIG="$GPG"
+ GPG=gpg_winpath
+fi
>1-14/+13 2018-02-08generate: disallow zero length generated passwordsJason A. Donenfeld1-1/+2 2018-02-01generate: in-place should work when file is emptyJason A. Donenfeld1-1/+1 2017-12-18Quote array specifierJason A. Donenfeld1-1/+1 2017-10-13protect dirname calls from pass-names that look like command-line optionsStacey Sheldon1-6/+6 2017-09-15passmenu: Don't eat whitespace at beginning/end of passwordDaniel Lublin1-1/+1 2017-08-29emacs: Release version 1.0.1 of Emacs packageSvend Sorensen2-5/+10 2017-08-29emacs: --run-async: Quote shell argumentsDamien Cassou1-4/+5 2017-08-29emacs: Update author's email addressSvend Sorensen1-2/+2 2017-08-29emacs: Fix package-lint violationsSvend Sorensen1-2/+3 2017-07-26emacs: Release version 1.0.0 of Emacs packageSvend Sorensen2-1/+8 2017-07-26emacs: Use with-editor to wrap "pass edit"Svend Sorensen2-9/+17 2017-04-13Bump version1.7.1Jason A. Donenfeld1-1/+1 2017-04-13init: match only the public keyJason A. Donenfeld1-1/+1 2017-03-28Use $GPG variableJason A. Donenfeld1-3/+3 2017-03-20Fix compatibility with GnuPG 2.2.19Andreas Stieger2-2/+2 2017-03-01tests: fix on OSX by not using the tr hackJason A. Donenfeld3-5/+2 2017-02-26Bump version1.7Jason A. Donenfeld1-1/+1 2017-02-26Modernize makefileJason A. Donenfeld2-31/+36 2017-02-25CopyrightJason A. Donenfeld1-1/+1 2017-02-25StyleJason A. Donenfeld1-2/+2 2017-02-25git: use inner-most directoryJason A. Donenfeld2-27/+48 2017-02-25clip: sleep may require argv[0] to be sleepJason A. Donenfeld1-1/+1 2017-02-25man: document system extensionsJason A. Donenfeld1-2/+3