diff options
author | Justus Winter <[email protected]> | 2016-09-06 14:35:40 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2016-09-06 14:46:31 +0000 |
commit | f2249b737055f84842778285bbeff5e61fa55225 (patch) | |
tree | c295d1f3d8a8c30ca2cb935b8a6162a29ed46165 /tests/gpgscm/main.c | |
parent | tests: Fix test. (diff) | |
download | gnupg-f2249b737055f84842778285bbeff5e61fa55225.tar.gz gnupg-f2249b737055f84842778285bbeff5e61fa55225.zip |
gpgscm: Fix detection of unbalanced parenthesis.
* tests/gpgscm/main.c (load): Print error message.
* tests/gpgscm/scheme.c (opexe_0): Correctly report nesting level when
loading files.
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'tests/gpgscm/main.c')
-rw-r--r-- | tests/gpgscm/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/gpgscm/main.c b/tests/gpgscm/main.c index 34ebb9f83..9aef1f3fd 100644 --- a/tests/gpgscm/main.c +++ b/tests/gpgscm/main.c @@ -32,6 +32,7 @@ #include "private.h" #include "scheme.h" +#include "scheme-private.h" #include "ffi.h" #include "i18n.h" #include "../../common/argparse.h" @@ -176,6 +177,13 @@ load (scheme *sc, char *file_name, scheme_load_named_file (sc, h, qualified_name); fclose (h); + if (sc->retcode) + { + if (sc->nesting) + fprintf (stderr, "%s: Unbalanced parenthesis\n", qualified_name); + return gpg_error (GPG_ERR_GENERAL); + } + if (file_name != qualified_name) free (qualified_name); return 0; |