about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2015-12-25 21:15:26 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2015-12-25 21:15:26 +0000
commit4ce684c4978610d1ea42be1b00f7332f3f5f337a (patch)
treef9e343be94161a4837f0f1c1d072a35538ae0f63
parent63fe73995bd1d496f1465a4446c0adc833d204dc (diff)
downloadnetpbm-mirror-4ce684c4978610d1ea42be1b00f7332f3f5f337a.tar.gz
netpbm-mirror-4ce684c4978610d1ea42be1b00f7332f3f5f337a.tar.xz
netpbm-mirror-4ce684c4978610d1ea42be1b00f7332f3f5f337a.zip
Release 10.47.59
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@2666 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rwxr-xr-xbuildtools/stamp-date2
-rwxr-xr-xconverter/other/anytopnm37
-rw-r--r--converter/other/pnmtops.c2
-rw-r--r--doc/HISTORY19
-rw-r--r--editor/pnmpaste.c2
-rw-r--r--version.mk2
6 files changed, 52 insertions, 12 deletions
diff --git a/buildtools/stamp-date b/buildtools/stamp-date
index 808bab79..5fb6c13a 100755
--- a/buildtools/stamp-date
+++ b/buildtools/stamp-date
@@ -12,7 +12,7 @@
 DATE=`date`
 LOGNAME_OR_UNKNOWN=${LOGNAME:-UNKNOWN}
 USER=${USER:-$LOGNAME_OR_UNKNOWN}
-if [ $USER = "UNKNOWN" ]; then
+if [ "$USER" = "UNKNOWN" ]; then
     USER=`whoami`
 fi
 
diff --git a/converter/other/anytopnm b/converter/other/anytopnm
index 82f57b3b..06f48b4f 100755
--- a/converter/other/anytopnm
+++ b/converter/other/anytopnm
@@ -47,18 +47,39 @@ putInputIntoTempfile() {
 
 
 setMimeType() {
+#------------------------------------------------------------------------------
+# Set variable 'mimeType' to the mime type string (e.g. "application/binary")
+#
+# If we can't tell, set it to "unknown".
+#------------------------------------------------------------------------------
     # $1 is the file name
 
-    # Christos Zoulas's current 'file' (see Freshmeat) has the --mime option.
+    # Old versions of 'file' cannot tell us the mime type; they lack any option
+    # to do so.
+    #
+    # Newer ones have a --mime option for that.
+    #
+    # Still newer ones (ca 2008) have a --mime option, but it does something
+    # different - it prints the mime type plus the mime encoding.  And they
+    # have --mime-type to print just the mime type.
 
-    file --mime /dev/null >/dev/null 2>/dev/null
+    file --mime-type /dev/null >/dev/null 2>/dev/null
     if [ $? -eq 0 ]; then
-        # Now that we know the --mime option exists, use it.
-        mimeType=`file --mime "$1" | cut -d: -f2- | cut -c2-`
+        # Now that we know the --mime-type option exists, use it.
+        mimeType=`file --mime-type "$1" | cut -d: -f2- | cut -c2-`
     else
-        # file --mime failed; we don't know why, but we assume it's because it
-        # is a traditional 'file' program that doesn't have a --mime option.
-    mimeType="unknown"
+        # file --mime-type failed; we don't know why, but we assume it's
+        # because it is an older 'file' program that doesn't have a --mime-type
+        # option.
+        file --mime /dev/null >/dev/null 2>/dev/null
+        if [ $? -eq 0 ]; then
+            # Now that we know the --mime option exists, use it.
+            mimeType=`file --mime "$1" | cut -d: -f2- | cut -c2-`
+        else
+            # file --mime failed; we don't know why, but we assume it's because
+            # it is an older 'file' program that doesn't have a --mime option.
+            mimeType="unknown"
+        fi
     fi
 }
 
@@ -109,7 +130,7 @@ computeTypeFromTypeDescription () {
 
     case "$1" in
     
-        *PBM* | *PGM* | *PPM* )
+        *PBM* | *PGM* | *PPM* | *Netpbm*PAM*)
             filetype=pnm
             ;;
     
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c
index 8fc8ba6b..20395952 100644
--- a/converter/other/pnmtops.c
+++ b/converter/other/pnmtops.c
@@ -1168,7 +1168,7 @@ convertPage(FILE * const ifP,
             bool   const dict,
             bool   const vmreclaim,
             bool   const levelIsGiven,
-            bool   const levelGiven) {
+            unsigned int const levelGiven) {
     
     struct pam inpam;
     tuple* tuplerow;
diff --git a/doc/HISTORY b/doc/HISTORY
index add28ec2..c70595c9 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,25 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+15.12.25 BJH  Release 10.47.59
+
+              anytopnm: use --mime-type option instead of --mime on newer
+              'file' program (on which --mime has a new meaning so that
+              'anytopnm' cannot recognize some file types).
+
+              anytopnm: recognize "Netpbm PAM" non-mime output from 'file'
+              program as indicating PAM.
+
+              pnmtops: fix bug: always things -level=N is -level=1.
+              Introduced after Netpbm 10.26 (January 2005) but before 10.35
+              (August 2006).  Manifests only with recent compilers.
+
+              pnmpaste: fix bug with PBM: incorrect output.  Introduced in
+              Netpbm 10.44 (September 2008).
+
+              Build: fix superfluous error message when USER environment
+              variable contains whitespace.  Broken since primordial Netpbm.
+
 15.08.15 BJH  Release 10.47.58
 
               fitstopnm: Add message saying you're probably making a mistake
diff --git a/editor/pnmpaste.c b/editor/pnmpaste.c
index 3fd9d521..33834669 100644
--- a/editor/pnmpaste.c
+++ b/editor/pnmpaste.c
@@ -125,7 +125,7 @@ rightBits(unsigned char const x,
 -----------------------------------------------------------------------------*/
     assert(n <= 8);
 
-    return (x << (8-n)) >> (8-n);
+    return ((unsigned char)(x << (8-n))) >> (8-n);
 }
 
 
diff --git a/version.mk b/version.mk
index 6d99a98f..d17e51f8 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 47
-NETPBM_POINT_RELEASE = 58
+NETPBM_POINT_RELEASE = 59