If so, there is only the one-liner patch to consider.

This patch doesn't apply anymore. Please submit an updated patch for the commit fest.

In src/include/utils/elog.h there is an include for "utils/errcodes.h" which is generated somehow when compiling postgresql but not present by default. So you have to compile postgresql and then the contrib, or use PGXS with an already installed version.

With this caveat, the one-liner patch (4 characters removed) reattached does compile for me:

  sh> git branch ismn2
  sh> git checkout ismn2
  sh> patch -p1 < ~/ismn-checksum.patch
  patching file contrib/isn/isn.c
  sh> ...
  sh> cd contrib/isn
  sh> make
  gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith 
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute 
-Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard 
-fpic -I. -I. -I../../src/include -D_GNU_SOURCE   -c -o isn.o isn.c
  gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith 
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute 
-Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard 
-fpic -L../../src/port -L../../src/common -Wl,--as-needed 
-Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags  -shared -o isn.so isn.o
  sh>

--
Fabien
diff --git a/contrib/isn/isn.c b/contrib/isn/isn.c
index 3db6b84..c4e2333 100644
--- a/contrib/isn/isn.c
+++ b/contrib/isn/isn.c
@@ -827,7 +827,7 @@ string2ean(const char *str, bool errorOK, ean13 *result,
 		case ISMN:
 			strncpy(buf, "9790", 4);	/* this isn't for sure yet, for now
 										 * ISMN it's only 9790 */
-			valid = (valid && ((rcheck = checkdig(buf + 3, 10)) == check || magic));
+			valid = (valid && ((rcheck = checkdig(buf, 13)) == check || magic));
 			break;
 		case ISBN:
 			strncpy(buf, "978", 3);
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to