summaryrefslogtreecommitdiff
path: root/x2p
diff options
context:
space:
mode:
authorLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1989-11-17 03:02:59 +0000
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1989-11-17 03:02:59 +0000
commitffed7fefd1d95d05e699dababfbb57ef2497cea1 (patch)
treeac02e16ead3b52915c921545a9ccb80f5c857501 /x2p
parent0d3e774cdb279a1eadd8282d49334b9b1bfd42ed (diff)
downloadperl-ffed7fefd1d95d05e699dababfbb57ef2497cea1.tar.gz
perl 3.0 patch #6 patch 5 continued
See patch 5.
Diffstat (limited to 'x2p')
-rw-r--r--x2p/s2p.SH21
-rw-r--r--x2p/walk.c15
2 files changed, 27 insertions, 9 deletions
diff --git a/x2p/s2p.SH b/x2p/s2p.SH
index e428d41910..fc85209d34 100644
--- a/x2p/s2p.SH
+++ b/x2p/s2p.SH
@@ -28,9 +28,13 @@ $spitshell >s2p <<!GROK!THIS!
: In the following dollars and backticks do not need the extra backslash.
$spitshell >>s2p <<'!NO!SUBS!'
-# $Header: s2p.SH,v 3.0.1.1 89/11/11 05:08:25 lwall Locked $
+# $Header: s2p.SH,v 3.0.1.2 89/11/17 15:51:27 lwall Locked $
#
# $Log: s2p.SH,v $
+# Revision 3.0.1.2 89/11/17 15:51:27 lwall
+# patch5: in s2p, line labels without a subsequent statement were done wrong
+# patch5: s2p left residue in /tmp
+#
# Revision 3.0.1.1 89/11/11 05:08:25 lwall
# patch2: in s2p, + within patterns needed backslashing
# patch2: s2p was printing out some debugging info to the output file
@@ -109,7 +113,11 @@ line: while (<>) {
$toplabel = $label;
}
$_ = "$label:";
- if ($lastlinewaslabel++) {$_ .= "\t;";}
+ if ($lastlinewaslabel++) {
+ $indent += 4;
+ print body "\t" x ($indent / 8), ' ' x ($indent % 8), ";\n";
+ $indent -= 4;
+ }
if ($indent >= 2) {
$indent -= 2;
$indmod = 2;
@@ -198,6 +206,11 @@ line: while (<>) {
redo line;
}
}
+if ($lastlinewaslabel++) {
+ $indent += 4;
+ print body "\t" x ($indent / 8), ' ' x ($indent % 8), ";\n";
+ $indent -= 4;
+}
print body "}\n";
if ($appendseen || $tseen || !$assumen) {
@@ -259,10 +272,10 @@ eval \"exec $bin/perl -S \$0 \$*\"
}
}
-unlink "/tmp/sperl$$", "/tmp/sperl2$$";
+unlink "/tmp/sperl$$", "/tmp/sperl2$$", "/tmp/sperl2$$.c";
sub Die {
- unlink "/tmp/sperl$$", "/tmp/sperl2$$";
+ unlink "/tmp/sperl$$", "/tmp/sperl2$$", "/tmp/sperl2$$.c";
die $_[0];
}
sub make_filehandle {
diff --git a/x2p/walk.c b/x2p/walk.c
index d0ea34112c..62b64a4a86 100644
--- a/x2p/walk.c
+++ b/x2p/walk.c
@@ -1,4 +1,4 @@
-/* $Header: walk.c,v 3.0.1.1 89/11/11 05:09:33 lwall Locked $
+/* $Header: walk.c,v 3.0.1.2 89/11/17 15:53:00 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
@@ -6,6 +6,9 @@
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: walk.c,v $
+ * Revision 3.0.1.2 89/11/17 15:53:00 lwall
+ * patch5: on Pyramids, index(s, '}' + 128) doesn't find meta-}
+ *
* Revision 3.0.1.1 89/11/11 05:09:33 lwall
* patch2: in a2p, awk script with no line actions still needs main loop
*
@@ -1419,10 +1422,12 @@ sub Pick {\n\
if (!s)
fatal("Illegal for loop: %s",d);
*s++ = '\0';
- t = index(s,'}' + 128);
- if (!t)
- t = index(s,']' + 128);
- if (t)
+ for (t = s; i = *t; t++) {
+ i &= 127;
+ if (i == '}' || i == ']')
+ break;
+ }
+ if (*t)
*t = '\0';
str = str_new(0);
str_set(str,d+1);