about summary refs log tree commit diff
path: root/converter/ppm
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-10-21 18:21:57 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-10-21 18:21:57 +0000
commit92bbdd2b0a68168b42d1d8381978ebedb098dafb (patch)
treeeb5823ca607acd28969e7f2fc10eebf991124715 /converter/ppm
parentedb3f361e8a1080c3583f35b17b7ca94af5702ac (diff)
downloadnetpbm-mirror-92bbdd2b0a68168b42d1d8381978ebedb098dafb.tar.gz
netpbm-mirror-92bbdd2b0a68168b42d1d8381978ebedb098dafb.tar.xz
netpbm-mirror-92bbdd2b0a68168b42d1d8381978ebedb098dafb.zip
Fix bug: -lib and -dir always say slide not found. Broken by cleanup rev 1946
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3089 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/ppm')
-rw-r--r--converter/ppm/sldtoppm.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/converter/ppm/sldtoppm.c b/converter/ppm/sldtoppm.c
index ef541da2..9a41cde3 100644
--- a/converter/ppm/sldtoppm.c
+++ b/converter/ppm/sldtoppm.c
@@ -210,27 +210,27 @@ slidefind(const char * const sname,
             eof = true;
         else if (strlen((char *)libent) == 0)
             eof = true;
-    }
-    if (!eof) {
-        pos += 36;
-        if (dironly) {
-            pm_message("  %s", libent);
-        } else if (streq((char *)libent, uname)) {
-            long dpos;
 
-            dpos = (((((libent[35] << 8) | libent[34]) << 8) |
-                     libent[33]) << 8) | libent[32];
+        if (!eof) {
+            pos += 36;
+            if (dironly) {
+                pm_message("  %s", libent);
+            } else if (streq((char *)libent, uname)) {
+                long dpos;
+
+                dpos = (((((libent[35] << 8) | libent[34]) << 8) |
+                         libent[33]) << 8) | libent[32];
 
-            if ((slfile == stdin) || (fseek(slfile, dpos, 0) == -1)) {
-                dpos -= pos;
+                if ((slfile == stdin) || (fseek(slfile, dpos, 0) == -1)) {
+                    dpos -= pos;
 
-                while (dpos-- > 0)
-                    getc(slfile);
+                    while (dpos-- > 0)
+                        getc(slfile);
+                }
+                found = true;
             }
-            found = true;
         }
     }
-
     if (!found && !dironly)
         pm_error("slide '%s' not in library.", sname);
 }