about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-09-07 17:10:50 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-09-07 17:10:50 +0000
commit48ca4ce15bd3240ba65ffde9c6dc3be518bedfd3 (patch)
tree7eea8829d4d1b73dba37616ca8c587e100319382 /lib
parent37693f98c95a44079507ccbb7fc51fbab72d6479 (diff)
downloadnetpbm-mirror-48ca4ce15bd3240ba65ffde9c6dc3be518bedfd3.tar.gz
netpbm-mirror-48ca4ce15bd3240ba65ffde9c6dc3be518bedfd3.tar.xz
netpbm-mirror-48ca4ce15bd3240ba65ffde9c6dc3be518bedfd3.zip
Add comments, whitespace
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4935 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib')
-rw-r--r--lib/libpm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/libpm.c b/lib/libpm.c
index f9fe514d..129ee72d 100644
--- a/lib/libpm.c
+++ b/lib/libpm.c
@@ -365,24 +365,25 @@ pm_freearray(char ** const rowIndex,
 
 
 
-/* Case-insensitive keyword matcher. */
-
 int
 pm_keymatch(const char * const strarg,
             const char * const keywordarg,
             int          const minchars) {
+/*----------------------------------------------------------------------------
+   Return 1 if the string 'strarg' matches the first 'minchars' characters
+   of 'keywordarg', ignoring case; 0 if it does not.
+-----------------------------------------------------------------------------*/
     int len;
     const char * keyword;
     const char * str;
 
-    str = strarg;
+    str     = strarg;
     keyword = keywordarg;
 
     len = strlen(str);
     if (len < minchars)
         return 0;
-    while (--len >= 0)
-        {
+    while (--len >= 0) {
         register char c1, c2;
 
         c1 = *str++;
@@ -395,7 +396,7 @@ pm_keymatch(const char * const strarg,
             c2 = tolower(c2);
         if (c1 != c2)
             return 0;
-        }
+    }
     return 1;
 }