]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix encoding of final CTRL-D in PS output.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 16 Aug 2007 18:28:44 +0000 (18:28 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 16 Aug 2007 18:28:44 +0000 (18:28 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@6800 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.3.txt
monitor/bcp.c
monitor/tbcp.c

index d2ad0cb79d3bf084b510c8bd3a4fb8deada1af44..60a9015af7ccf84352666f1a98079f75a817cd6b 100644 (file)
@@ -4,6 +4,8 @@ CHANGES-1.3.txt
 
 CHANGES IN CUPS V1.3.1
 
+       - The TBCP and BCP port monitors did not handle the trailing
+         CTRL-D in some PostScript output properly.
        - Fixed the localization instructions and German template for
          the "Find New Printers" button (STR #2478)
        - The web interface did not work with the Chinese localization
index d3cbd9e00ead3649139e3baf75bcd8daad1e3f37..3b8eaccba1f7e4cc3ab9097298fd6ead07b204a7 100644 (file)
@@ -16,6 +16,9 @@
  *
  * Contents:
  *
+ *   main()    - Main entry...
+ *   psgets()  - Get a line from a file.
+ *   pswrite() - Write data from a file.
  */
 
 /*
@@ -248,9 +251,19 @@ pswrite(const char *buf,           /* I - Buffer to write */
   for (count = bytes; count > 0; count --, buf ++)
     switch (*buf)
     {
+      case 0x04 : /* CTRL-D */
+          if (bytes == 1)
+         {
+          /*
+           * Don't quote the last CTRL-D...
+           */
+
+           putchar(0x04);
+           break;
+         }
+
       case 0x01 : /* CTRL-A */
       case 0x03 : /* CTRL-C */
-      case 0x04 : /* CTRL-D */
       case 0x05 : /* CTRL-E */
       case 0x11 : /* CTRL-Q */
       case 0x13 : /* CTRL-S */
index 4369bab8c360495e191fe75f1c20bf303f3f0948..d10ee345fb9c258ef7262143988173d32b4bad90 100644 (file)
@@ -120,11 +120,10 @@ main(int  argc,                           /* I - Number of command-line args */
     else
     {
      /*
-      * No PJL stuff, add it...
+      * No PJL stuff, just add the UEL...
       */
 
-      puts("\033%-12345X@PJL");
-      puts("@PJL ENTER LANGUAGE = POSTSCRIPT");
+      fputs("\033%-12345X", stdout);
     }
 
    /*
@@ -244,9 +243,19 @@ pswrite(const char *buf,           /* I - Buffer to write */
   for (count = bytes; count > 0; count --, buf ++)
     switch (*buf)
     {
+      case 0x04 : /* CTRL-D */
+          if (bytes == 1)
+         {
+          /*
+           * Don't quote the last CTRL-D...
+           */
+
+           putchar(0x04);
+           break;
+         }
+
       case 0x01 : /* CTRL-A */
       case 0x03 : /* CTRL-C */
-      case 0x04 : /* CTRL-D */
       case 0x05 : /* CTRL-E */
       case 0x11 : /* CTRL-Q */
       case 0x13 : /* CTRL-S */