diff options
-rw-r--r-- | converter/pbm/xbmtopbm.c | 20 | ||||
-rw-r--r-- | doc/HISTORY | 3 |
2 files changed, 18 insertions, 5 deletions
diff --git a/converter/pbm/xbmtopbm.c b/converter/pbm/xbmtopbm.c index 28d1f06c..1f5384ed 100644 --- a/converter/pbm/xbmtopbm.c +++ b/converter/pbm/xbmtopbm.c @@ -116,18 +116,28 @@ parseDeclaration(const char * const line, *isDeclarationP = TRUE; } else { int rc; - rc = sscanf(line, "static char %s = {", nameAndType); + rc = sscanf(line, "static unsigned short %s = {", nameAndType); if (rc == 1) { - *version10P = FALSE; + /* This is apparently not legal X10 XBM; we recognize it as an + extension. Many non-Netpbm programs won't. + */ + *version10P = TRUE; *isDeclarationP = TRUE; } else { int rc; - rc = sscanf(line, "static unsigned char %s = {", nameAndType); + rc = sscanf(line, "static char %s = {", nameAndType); if (rc == 1) { *version10P = FALSE; *isDeclarationP = TRUE; - } else - *isDeclarationP = FALSE; + } else { + int rc; + rc = sscanf(line, "static unsigned char %s = {", nameAndType); + if (rc == 1) { + *version10P = FALSE; + *isDeclarationP = TRUE; + } else + *isDeclarationP = FALSE; + } } } } diff --git a/doc/HISTORY b/doc/HISTORY index 8a67bfe9..c54ecb96 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -9,6 +9,9 @@ not yet BJH Release 10.91.00 pnmtorle: Fix incorrect command and filename in header. Brokne in Netpbm 10.88 (September 2019). + xbmtopbm: Recognize "unsigned short" as an extension of + XBM X10 format. + 20.03.26 BJH Release 10.90.00 pamundice: Add -listfile. |