diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-04-27 22:57:02 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-04-27 22:57:02 +0000 |
commit | 3397d6dc422159ecd1e13628990ea8b53123a236 (patch) | |
tree | f5dcf768bc0f6a11f4a78a76a324048ab99e634e /converter/pbm | |
parent | eb321a03f15398dd8f49dca26c5ef6df058526da (diff) | |
download | netpbm-mirror-3397d6dc422159ecd1e13628990ea8b53123a236.tar.gz netpbm-mirror-3397d6dc422159ecd1e13628990ea8b53123a236.tar.xz netpbm-mirror-3397d6dc422159ecd1e13628990ea8b53123a236.zip |
Accept 'static unsigned short' in an X10 XBM
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3797 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/pbm')
-rw-r--r-- | converter/pbm/xbmtopbm.c | 20 |
1 files changed, 15 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; + } } } } |