1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

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 <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-09-06 16:35:40 +02:00
parent 213b3cf465
commit f2249b7370
2 changed files with 9 additions and 0 deletions

View file

@ -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;