aboutsummaryrefslogtreecommitdiffstats
path: root/japanese/a2ps/files/patch-aa
blob: f153be5be209d4d09f5d16819e3a7a39f38e432d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
--- a2ps-j.orig 2011-09-19 17:05:32.000000000 +0900
+++ a2ps-j  2011-09-19 17:09:07.000000000 +0900
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
 ;#
 ;# a2ps: ascii to ps
 ;#
@@ -192,7 +192,8 @@
 
 if ($debug == 2) {
     require('dumpvar.pl');
-    local($#) = '%.6g';
+##  Perl 5.10.1 says $# is no longer supported
+##  local($#) = '%.6g';
     &dumpvar('main',
         'width', 'height', 'lmargin', 'smargin', 'font_size',
         'sheet_height', 'sheet_width', 'char_width', 'skip_column',
@@ -208,8 +209,14 @@
     $file = shift;
     if ($file && !-r $file) { warn "$file: $!\n"; next; }
     if ($jisconvert) {
-   require 'flush.pl';
-   &flush(STDOUT);
+   # flush.pl obsolete (originally in Perl 4)
+   # replaced with equivalent code of &flush(STDOUT)
+   local($old_stdout) = select(STDOUT);
+   $| = 1;
+   print "";
+   $| = 0;
+   select($old_stdout);
+   # end of equivalent code
    open(F, "-|") || &jis($file);
     } else {
    $file = '-' if $file eq '';
@@ -476,10 +483,13 @@
 }
 
 sub print_header {
-    require('ctime.pl');
     return if $header_is_printed++;
 
-    chop(local($date) = &ctime(time));
+    # ctime.pl obsolete (originally in Perl 4)
+    # ctime.pl behaves differently when TZ is not set,
+    # but the behavior will not affect the PostScript file details
+    local($date) = scalar localtime;
+
     local($orientation) = $portrait ? "Portrait" : "Landscape";
 
     print <<"---";
@@ -525,7 +535,8 @@
     printf("/lines %d def\n", $linesperpage);
     printf("/columns %d def\n", $columnsperline);
     $sublabel = $default_sublabel unless defined $sublabel;
-    print "/date (", &date($sublabel, time), ") def\n";
+    # function name changed to a2ps_date to avoid confusion
+    print "/date (", &a2ps_date($sublabel, time), ") def\n";
     if ($ascii_mag) {
    printf("/doasciimag true def /asciimagsize %f def\n", $ascii_mag);
     } else {
@@ -548,7 +559,8 @@
     print "%%EndProlog\n\n";
 }
 
-sub date {
+# function name changed to a2ps_date to avoid confusion
+sub a2ps_date {
     local($_, $time) = @_;
     local($sec, $min, $hour, $mday, $mon, $year, $wday) = localtime($time);
     $year += 1900;