diff options
author | Maximilian Krambach <[email protected]> | 2018-04-20 13:23:57 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-04-20 13:23:57 +0000 |
commit | 94f21d9f6bc1cf94e068e26eae53e593189dcec6 (patch) | |
tree | b176a836c504cbd71a5ca17ca025b23285d1505a /src/op-support.c | |
parent | js: Initial commit for JavaScript Native Messaging API (diff) | |
parent | core: Do not modify args for ignored failures (diff) | |
download | gpgme-94f21d9f6bc1cf94e068e26eae53e593189dcec6.tar.gz gpgme-94f21d9f6bc1cf94e068e26eae53e593189dcec6.zip |
Merge branch 'master' into javascript-binding
Diffstat (limited to 'src/op-support.c')
-rw-r--r-- | src/op-support.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/op-support.c b/src/op-support.c index 43cb1c76..9414e612 100644 --- a/src/op-support.c +++ b/src/op-support.c @@ -358,7 +358,7 @@ _gpgme_parse_key_considered (const char *args, /* Parse the PLAINTEXT status line in ARGS and return the result in FILENAMEP. */ gpgme_error_t -_gpgme_parse_plaintext (char *args, char **filenamep) +_gpgme_parse_plaintext (char *args, char **filenamep, int *r_mime) { char *tail; @@ -367,7 +367,9 @@ _gpgme_parse_plaintext (char *args, char **filenamep) if (*args == '\0') return 0; - /* First argument is file type. */ + /* First argument is file type (a one byte uppercase hex value). */ + if (args[0] == '6' && args[1] == 'D') + *r_mime = 1; while (*args != ' ' && *args != '\0') args++; while (*args == ' ') @@ -400,12 +402,21 @@ _gpgme_parse_plaintext (char *args, char **filenamep) /* Parse a FAILURE status line and return the error code. ARGS is - modified to contain the location part. */ + * modified to contain the location part. Note that for now we ignore + * failure codes with a location of gpg-exit; they are too trouble + * some. Instead we should eventually record that error in the + * context and provide a function to return a fuller error + * description; this could then also show the location of the error + * (e.g. "option- parser") to make it easier for the user to detect + * the actual error. */ gpgme_error_t _gpgme_parse_failure (char *args) { char *where, *which; + if (!strncmp (args, "gpg-exit", 8)) + return 0; + where = strchr (args, ' '); if (!where) return trace_gpg_error (GPG_ERR_INV_ENGINE); @@ -417,7 +428,5 @@ _gpgme_parse_failure (char *args) if (where) *where = '\0'; - where = args; - return atoi (which); } |