From 0e6b891b8e24d198ade58999ffb29ccc578da669 Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Tue, 5 Jul 2011 08:44:44 +0200 Subject: [PATCH] Make symmetric encryption working again. --- plugin/gnupg.vim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index a5c74c0..a51e1d4 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -121,12 +121,14 @@ fun s:GPGInit() " windows specific settings let s:shellredir = '>%s' let s:shell = &shell - let s:redirnull = '2>nul' + let s:stderrredir = '2>&1' + let s:stderrredirnull = '2>nul' else " unix specific settings let s:shellredir = &shellredir let s:shell = 'sh' - let s:redirnull ='2>/dev/null' + let s:stderrredir = '2>&1' + let s:stderrredirnull ='2>/dev/null' endi " find the supported algorithms @@ -158,7 +160,7 @@ fun s:GPGDecrypt() " find the recipients of the file let &shellredir=s:shellredir let &shell=s:shell - let output=system(s:GPGCommand . " --decrypt --dry-run --batch " . filename) + let output=system(s:GPGCommand . " --decrypt --dry-run --batch --no-use-agent " . filename . " " . s:stderrredir) let &shellredir=s:shellredir let &shell=s:shellsave @@ -209,7 +211,7 @@ fun s:GPGDecrypt() " we must redirect stderr (using shell temporarily) let &shellredir=s:shellredir let &shell=s:shell - exec "'[,']!" . s:GPGCommand . " --quiet --decrypt " . s:redirnull + exec "'[,']!" . s:GPGCommand . " --quiet --decrypt " . s:stderrredirnull let &shellredir=s:shellredir let &shell=s:shellsave if (v:shell_error) " message could not be decrypted @@ -274,7 +276,7 @@ fun s:GPGEncrypt() " encrypt the buffer let &shellredir=s:shellredir let &shell=s:shell - silent exec "'[,']!" . s:GPGCommand . " --quiet --no-encrypt-to " . options . recipients . " " . s:redirnull + silent exec "'[,']!" . s:GPGCommand . " --quiet --no-encrypt-to " . options . recipients . " " . s:stderrredirnull let &shellredir=s:shellredir let &shell=s:shellsave if (v:shell_error) " message could not be encrypted