~ubuntu-branches/ubuntu/raring/cups-filters/raring-proposed

« back to all changes in this revision

Viewing changes to debian/patches/texttopdf-fix-deficient-string-escaping.patch

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2012-09-25 06:15:07 UTC
  • Revision ID: package-import@ubuntu.com-20120925061507-u3lruaaw7houdbr3
Tags: 1.0.24-2
debian/patches/texttopdf-fix-deficient-string-escaping.patch: Fixed
unsufficient string escaping in texttopdf (Upstream bug #1071).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- a/filter/pdfutils.c
 
2
+++ b/filter/pdfutils.c
 
3
@@ -37,7 +37,7 @@
 
4
     len=strlen(str);
 
5
   }
 
6
   putc('(',stdout);
 
7
-  // escape special chars: \0 \\ \)
 
8
+  // escape special chars: \0 \\ \( \)  -- don't bother about balanced parens
 
9
   int iA=0;
 
10
   for (;len>0;iA++,len--) {
 
11
     if ( (str[iA]<32)||(str[iA]>126) ) {
 
12
@@ -46,7 +46,7 @@
 
13
       pdf->filepos+=iA+4;
 
14
       str+=iA+1;
 
15
       iA=-1;
 
16
-    } else if ( (str[iA]==')')||(str[iA]=='\\') ) {
 
17
+    } else if ( (str[iA]=='(')||(str[iA]==')')||(str[iA]=='\\') ) {
 
18
       fwrite(str,1,iA,stdout);
 
19
       fprintf(stdout,"\\%c",str[iA]);
 
20
       pdf->filepos+=iA+2;
 
21
@@ -287,7 +287,7 @@
 
22
   pdfOut *pdf=(pdfOut *)context;
 
23
 
 
24
   if (fwrite(buf,1,len,stdout)!=len) {
 
25
-    fprintf(stderr,"Short write: %m\n");
 
26
+    perror("Short write");
 
27
     assert(0);
 
28
     return;
 
29
   }