From: mike Date: Mon, 28 Oct 2002 17:33:30 +0000 (+0000) Subject: Mirror 1.1.x changes. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13f5eff61d56804476f09cdee96215a9e93afc0d;p=thirdparty%2Fcups.git Mirror 1.1.x changes. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@2950 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/CHANGES-1.1.txt b/CHANGES-1.1.txt index 5ef06abf7c..45d6cde82f 100644 --- a/CHANGES-1.1.txt +++ b/CHANGES-1.1.txt @@ -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 diff --git a/filter/common.c b/filter/common.c index 3db0fa78ff..7926a1ede2 100644 --- a/filter/common.c +++ b/filter/common.c @@ -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 $". */