summaryrefslogtreecommitdiff
path: root/x2p/walk.c
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1991-11-05 09:55:53 +0000
committerLarry Wall <lwall@netlabs.com>1991-11-05 09:55:53 +0000
commit55204971972392ce5a252fbbd6d78b1c48ed70e3 (patch)
treea0fc0fa7a40dae3b455667572b9aac94b020c246 /x2p/walk.c
parentde3bb51191e884300caf98892ecfcc0ca3ebc09c (diff)
downloadperl-55204971972392ce5a252fbbd6d78b1c48ed70e3.tar.gz
perl 4.0 patch 18: patch #11, continued
See patch #11.
Diffstat (limited to 'x2p/walk.c')
-rw-r--r--x2p/walk.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/x2p/walk.c b/x2p/walk.c
index f38968b0d5..271581b446 100644
--- a/x2p/walk.c
+++ b/x2p/walk.c
@@ -1,4 +1,4 @@
-/* $RCSfile: walk.c,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:22:04 $
+/* $RCSfile: walk.c,v $$Revision: 4.0.1.2 $$Date: 91/11/05 19:25:09 $
*
* Copyright (c) 1991, Larry Wall
*
@@ -6,6 +6,9 @@
* License or the Artistic License, as specified in the README file.
*
* $Log: walk.c,v $
+ * Revision 4.0.1.2 91/11/05 19:25:09 lwall
+ * patch11: in a2p, split on whitespace produced extra null field
+ *
* Revision 4.0.1.1 91/06/07 12:22:04 lwall
* patch4: new copyright notice
* patch4: a2p didn't correctly implement -n switch
@@ -30,6 +33,7 @@ bool saw_fh = FALSE;
int maxtmp = 0;
char *lparen;
char *rparen;
+char *limit;
STR *subs;
STR *curargs = Nullstr;
@@ -670,6 +674,7 @@ sub Pick {\n\
break;
case OSPLIT:
str = str_new(0);
+ limit = ", 9999)";
numeric = 1;
tmpstr = walk(1,level,ops[node+2].ival,&numarg,P_MIN);
if (useval)
@@ -700,12 +705,14 @@ sub Pick {\n\
}
else if (saw_FS)
str_cat(str,"$FS");
- else
+ else {
str_cat(str,"' '");
+ limit = ")";
+ }
str_cat(str,", ");
str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_COMMA+1));
str_free(fstr);
- str_cat(str,", 9999)");
+ str_cat(str,limit);
if (useval) {
str_cat(str,")");
}