diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-03-10 21:07:57 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-03-10 21:07:57 +0000 |
commit | 70934b2797bfef53a6fb85c131a5ec9d818dd92b (patch) | |
tree | 14c58816672bd4bc08b149912a00106844208fa4 | |
parent | 28740683b0a73d20e6991bde709e64126c3a6217 (diff) | |
download | mailutils-70934b2797bfef53a6fb85c131a5ec9d818dd92b.tar.gz mailutils-70934b2797bfef53a6fb85c131a5ec9d818dd92b.tar.bz2 |
(mu_mailcap_entry_get_value): Bugfix: return ENOENT if no matching entry is found.
-rw-r--r-- | mailbox/mailcap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mailbox/mailcap.c b/mailbox/mailcap.c index 048d9c8cf..57106ffc6 100644 --- a/mailbox/mailcap.c +++ b/mailbox/mailcap.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -343,11 +343,10 @@ mu_mailcap_entry_get_value (mu_mailcap_entry_t entry, const char *key, char *buffer, size_t buflen, size_t *pn) { int len = 0; - int status = 0; - if (entry == NULL) - { - status = EINVAL; - } + int status = ENOENT; + + if (!entry) + status = EINVAL; else { int i; @@ -358,6 +357,7 @@ mu_mailcap_entry_get_value (mu_mailcap_entry_t entry, const char *key, if (n == 0) { int field_len = strlen(entry->fields[i]); + status = 0; if (field_len > key_len) { int c = entry->fields[i][key_len]; |