]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Support <body> being indented.
authorMichael Sweet <michael.r.sweet@gmail.com>
Tue, 19 Dec 2017 02:29:42 +0000 (21:29 -0500)
committerMichael Sweet <michael.r.sweet@gmail.com>
Tue, 19 Dec 2017 02:29:42 +0000 (21:29 -0500)
cgi-bin/help.c

index 8f6aa54994a6b18f32752c80f4f0c38ec0c3eb67..faa1993d6ff2bf4ff1098ee912b29f40dc13d5fe 100644 (file)
@@ -329,20 +329,22 @@ main(int  argc,                           /* I - Number of command-line arguments */
     if ((fp = cupsFileOpen(filename, "r")) != NULL)
     {
       int      inbody;                 /* Are we inside the body? */
-
+      char     *lineptr;               /* Pointer into line */
 
       inbody = 0;
 
       while (cupsFileGets(fp, line, sizeof(line)))
       {
+        for (lineptr = line; *lineptr && isspace(*lineptr & 255); lineptr ++);
+
         if (inbody)
        {
-         if (!_cups_strncasecmp(line, "</BODY>", 7))
+         if (!_cups_strncasecmp(lineptr, "</BODY>", 7))
            break;
 
          printf("%s\n", line);
         }
-       else if (!_cups_strncasecmp(line, "<BODY", 5))
+       else if (!_cups_strncasecmp(lineptr, "<BODY", 5))
          inbody = 1;
       }