[svn] gpg-error - r187 - in trunk: . src
svn author marcus
cvs at cvs.gnupg.org
Fri Dec 1 14:03:25 CET 2006
Author: marcus
Date: 2006-12-01 14:03:16 +0100 (Fri, 01 Dec 2006)
New Revision: 187
Modified:
trunk/ChangeLog
trunk/src/gpg-error.c
Log:
2006-12-01 Marcus Brinkmann <marcus at g10code.de>
* src/gpg-error.c (get_err_from_number): Support source and code
number in split format like "7.17".
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-11-30 15:50:46 UTC (rev 186)
+++ trunk/ChangeLog 2006-12-01 13:03:16 UTC (rev 187)
@@ -1,3 +1,8 @@
+2006-12-01 Marcus Brinkmann <marcus at g10code.de>
+
+ * src/gpg-error.c (get_err_from_number): Support source and code
+ number in split format like "7.17".
+
2006-11-30 Werner Koch <wk at g10code.com>
Released 1.5.
Modified: trunk/src/gpg-error.c
===================================================================
--- trunk/src/gpg-error.c 2006-11-30 15:50:46 UTC (rev 186)
+++ trunk/src/gpg-error.c 2006-12-01 13:03:16 UTC (rev 187)
@@ -257,12 +257,24 @@
errno = 0;
nr = strtoul (str, &tail, 0);
- if (errno || *tail)
+ if (errno)
return 0;
- if (nr > UINT_MAX)
+ if (nr > GPG_ERR_CODE_DIM)
return 0;
+ if (*tail)
+ {
+ unsigned long cnr = strtoul (tail + 1, &tail, 0);
+ if (errno || *tail)
+ return 0;
+
+ if (cnr >= GPG_ERR_SOURCE_DIM)
+ return 0;
+
+ nr = gpg_err_make (nr, cnr);
+ }
+
*err = (unsigned int) nr;
return 1;
}
More information about the Gnupg-commits
mailing list