-/* $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"
STR *
walk(int useval, int level, register int node, int *numericptr, int minprec)
-
-
-
-
- /* minimum precedence without parens */
{
register int len;
register STR *str;
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:
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)
}
*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);
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);
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);
}