~ubuntu-branches/ubuntu/trusty/libspectre/trusty-proposed

« back to all changes in this revision

Viewing changes to libspectre/ps.c

  • Committer: Bazaar Package Importer
  • Author(s): Debian Krap Maintainers, Pino Toscano
  • Date: 2010-02-26 20:41:27 UTC
  • mfrom: (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100226204127-yiw1sl15vo4ufnsm
* New upstream release.

[ Pino Toscano ]
* Bump Standards-Version to 3.8.4, no changes required.
* Drop Build-Depend on autoconf, automake, autotools-dev, and libtool, as we
  don't autoreconf anymore.
* Adjust Build-Depends based on what the upstream configure checks:
  + add pkg-config >= 0.9.0.
  + set libgs-dev >= 8.62.
* Pass --list-missing to dh_install.
  + specify the .la file is not installed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
581
581
            } else {
582
582
                int page_order;
583
583
                
584
 
                switch (sscanf(line+length("%%Pages:"), "%d %d",
 
584
                switch (sscanf(line+length("%%Pages:"), "%u %d",
585
585
                               &maxpages, &page_order)) {
586
586
                    case 2:
587
587
                        if (page_order_set == NONE) {
588
588
                            if (page_order == -1) {
589
589
                                doc->pageorder = DESCEND;
590
 
                                page_order_set = 1;
591
590
                            } else if (page_order == 0) {
592
591
                                doc->pageorder = SPECIAL;
593
 
                                page_order_set = 1;
594
592
                            } else if (page_order == 1) {
595
593
                                doc->pageorder = ASCEND;
596
 
                                page_order_set = 1;
597
594
                            }
598
595
                        }
599
596
                    case 1:
864
861
                  iscomment(line+2, "Page:") ||
865
862
                  iscomment(line+2, "Trailer") ||
866
863
                  iscomment(line+2, "EOF")))) {
 
864
            if (iscomment(line, "%!PS")) {
 
865
                /* Embedded document in Prolog, typically font resources.
 
866
                 * Skip until end of resource or Prolog
 
867
                 */
 
868
                while (readline(fd, enddoseps, &line, &position, &line_len) &&
 
869
                       !(DSCcomment(line) &&
 
870
                         (iscomment(line+2, "EndProlog") ||
 
871
                          iscomment(line+2, "BeginSetup") ||
 
872
                          iscomment(line+2, "Page:") ||
 
873
                          iscomment(line+2, "Trailer") ||
 
874
                          iscomment(line+2, "EOF")))) {
 
875
                    section_len += line_len;
 
876
                }
 
877
            }
867
878
            if (!preread) section_len += line_len;
868
879
            preread = 0;
869
880
        }
1000
1011
            CHECK_MALLOCED(doc->pages);
1001
1012
        }
1002
1013
        label = ps_gettext(line+length("%%Page:"), &next_char);
1003
 
        if (sscanf(next_char, "%d", &thispage) != 1) thispage = 0;
 
1014
        if (sscanf(next_char, "%u", &thispage) != 1) thispage = 0;
1004
1015
        if (nextpage == 1) {
1005
1016
            ignore = thispage != 1;
1006
1017
        }
1111
1122
            /* Do nothing */
1112
1123
        } else if (iscomment(line+2, "Page:")) {
1113
1124
            PS_free(ps_gettext(line+length("%%Page:"), &next_char));
1114
 
            if (sscanf(next_char, "%d", &thispage) != 1) thispage = 0;
 
1125
            if (sscanf(next_char, "%u", &thispage) != 1) thispage = 0;
1115
1126
            if (!ignore && thispage == nextpage) {
1116
1127
                if (doc->numpages > 0) {
1117
1128
                    doc->pages[doc->numpages-1].end = position;
2116
2127
          fputs(comment, dest_file);
2117
2128
          pages_atend = True;
2118
2129
       } else {
2119
 
          switch (sscanf(comment+length("%%Pages:"), "%*d %d", &i)) {
 
2130
          switch (sscanf(comment+length("%%Pages:"), "%*d %u", &i)) {
2120
2131
             case 1:
2121
2132
                fprintf(dest_file, "%%%%Pages: %d %d\n", pages, i);
2122
2133
                break;
2151
2162
         PS_free(comment);
2152
2163
         continue;
2153
2164
      }
2154
 
      switch (sscanf(comment+length("%%Pages:"), "%*d %d", &i)) {
 
2165
      switch (sscanf(comment+length("%%Pages:"), "%*d %u", &i)) {
2155
2166
         case 1:
2156
2167
            fprintf(dest_file, "%%%%Pages: %d %d\n", pages, i);
2157
2168
            break;