shithub: jbig2

Download patch

ref: bf2f470f28a35f6670aa9b31214e0624364f992f
parent: 09f3c413c9112606dc3afae719884151280f4e9d
author: giles <giles@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Wed May 7 12:07:31 EDT 2003

strncasecmp() isn't portable. work around until we can provide our own.

(recommitted after repository became corrupt. original change dated Wed Apr 16 18:44:11 2003)


git-svn-id: http://svn.ghostscript.com/jbig2dec/trunk@240 ded80894-8fb9-0310-811b-c03f3676ab4d

--- a/jbig2dec.c
+++ b/jbig2dec.c
@@ -100,8 +100,10 @@
 set_output_format(jbig2dec_params_t *params, const char *format)
 {
 #ifdef HAVE_LIBPNG
-    if (!strncasecmp(format, "png", 3)) {
-    	params->output_format=jbig2dec_format_png;
+    /* this should really by strncasecmp()
+       TODO: we need to provide our own for portability */
+    if (!strncmp(format, "png", 3) || !strncmp(format, "PNG", 3)) {
+	params->output_format=jbig2dec_format_png;
     	return 0;
     }
 #endif