X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=x2p%2Fwalk.c;h=de1263fc16bfb4b02eea79389e81ce191e33f777;hb=9f10b7978c0f0158c4689058d5599a8d2c5e52da;hp=63ceb47cdc54506a0a8ec2b60800b33ee4b3bc56;hpb=4bb101f2758f169969171dfe6b70f68a406dcc1e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/x2p/walk.c b/x2p/walk.c index 63ceb47..de1263f 100644 --- a/x2p/walk.c +++ b/x2p/walk.c @@ -1,12 +1,10 @@ -/* $RCSfile: walk.c,v $$Revision: 4.1 $$Date: 92/08/07 18:29:31 $ +/* walk.c * * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, - * 2000, 2001, 2002, by Larry Wall and others + * 2000, 2001, 2002, 2005 by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. - * - * $Log: walk.c,v $ */ #include "EXTERN.h" @@ -43,11 +41,6 @@ char *instr(char *big, char *little); STR * walk(int useval, int level, register int node, int *numericptr, int minprec) - - - - - /* minimum precedence without parens */ { register int len; register STR *str; @@ -660,13 +653,11 @@ sub Pick {\n\ str_cat(str,", "); str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,P_COMMA+1)); str_free(fstr); - str_cat(str,", "); if (len == 3) { + str_cat(str,", "); str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,P_COMMA+1)); str_free(fstr); } - else - str_cat(str,"999999"); str_cat(str,")"); break; case OSTRING: @@ -675,7 +666,7 @@ sub Pick {\n\ break; case OSPLIT: str = str_new(0); - limit = ", 9999)"; + limit = ", -1)"; numeric = 1; tmpstr = walk(1,level,ops[node+2].ival,&numarg,P_MIN); if (useval) @@ -858,7 +849,7 @@ sub Pick {\n\ } *d = '\0'; str_set(tmp2str,tokenbuf); - s = gsub ? "/g" : "/"; + s = (char *) (gsub ? "/g" : "/"); } else { tmp2str=walk(1,level,ops[node+2].ival,&numarg,P_MIN); @@ -866,7 +857,7 @@ sub Pick {\n\ str_scat(tmp3str,tmp2str); str_cat(tmp3str,").'\"') =~ s/&/\\$&/g, "); str_set(tmp2str,"eval $s_"); - s = gsub ? "/ge" : "/e"; + s = (char *) (gsub ? "/ge" : "/e"); i++; } str_cat(tmp2str,s); @@ -1617,13 +1608,13 @@ emit_split(register STR *str, int level) str_cat(str,tokenbuf); } if (const_FS) { - sprintf(tokenbuf," = split(/[%c\\n]/, $_, 9999);\n",const_FS); + sprintf(tokenbuf," = split(/[%c\\n]/, $_, -1);\n",const_FS); str_cat(str,tokenbuf); } else if (saw_FS) - str_cat(str," = split($FS, $_, 9999);\n"); + str_cat(str," = split($FS, $_, -1);\n"); else - str_cat(str," = split(' ', $_, 9999);\n"); + str_cat(str," = split(' ', $_, -1);\n"); tab(str,level); }