]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 28 Oct 2002 17:33:30 +0000 (17:33 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 28 Oct 2002 17:33:30 +0000 (17:33 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@2950 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.1.txt
filter/common.c

index 5ef06abf7c0017108e6753ec403e6cf36508a8df..45d6cde82f108fa90de98353ac7f9a8df9cd9da2 100644 (file)
@@ -3,6 +3,9 @@ CHANGES-1.1.txt
 
 CHANGES IN CUPS V1.1.17
 
+       - User-defined classification strings are now printed
+         verbatim - previously the classification box would be
+         empty.
        - Re-added Spanish to the list of PPD languages that
          CUPS supports.
        - CUPS API library user and temp file updates for
index 3db0fa78ff47c0f3b969ce532420f21cfa487c7f..7926a1ede2887ddf4c1c1531c4f8ac8d6f8be72f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: common.c,v 1.15.2.9 2002/10/17 17:06:00 mike Exp $"
+ * "$Id: common.c,v 1.15.2.10 2002/10/28 17:33:30 mike Exp $"
  *
  *   Common filter routines for the Common UNIX Printing System (CUPS).
  *
@@ -328,6 +328,7 @@ WriteLabelProlog(const char *label, /* I - Page label */
                 float      width)      /* I - Width in points */
 {
   const char   *classification;        /* CLASSIFICATION environment variable */
+  const char   *ptr;                   /* Temporary string pointer */
 
 
  /*
@@ -366,8 +367,21 @@ WriteLabelProlog(const char *label,        /* I - Page label */
   else if (strcmp(classification, "unclassified") == 0)
     printf("/ESPpl(UNCLASSIFIED");
   else
+  {
     printf("/ESPpl(");
 
+    for (ptr = classification; *ptr; ptr ++)
+      if (*ptr < 32 || *ptr > 126)
+        printf("\\%03o", *ptr);
+      else
+      {
+       if (*ptr == '(' || *ptr == ')' || *ptr == '\\')
+         putchar('\\');
+
+       putchar(*ptr);
+      }
+  }
+
   if (label)
   {
     if (classification[0])
@@ -377,20 +391,16 @@ WriteLabelProlog(const char *label,       /* I - Page label */
     * Quote the label string as needed...
     */
 
-    while (*label)
-    {
-      if (*label < 32 || *label > 126)
-        printf("\\%03o", *label);
+    for (ptr = label; *ptr; ptr ++)
+      if (*ptr < 32 || *ptr > 126)
+        printf("\\%03o", *ptr);
       else
       {
-       if (*label == '(' || *label == ')' || *label == '\\')
+       if (*ptr == '(' || *ptr == ')' || *ptr == '\\')
          putchar('\\');
 
-       putchar(*label);
+       putchar(*ptr);
       }
-
-      label ++;
-    }
   }
 
   puts(")put");
@@ -465,5 +475,5 @@ WriteLabels(int orient)     /* I - Orientation of the page */
 
 
 /*
- * End of "$Id: common.c,v 1.15.2.9 2002/10/17 17:06:00 mike Exp $".
+ * End of "$Id: common.c,v 1.15.2.10 2002/10/28 17:33:30 mike Exp $".
  */