enhanced split(),ENVIRON,ARGV in awk to build a numeric string if a string can be converted to a number

This commit is contained in:
2013-05-29 08:46:23 +00:00
parent 15300bfcfc
commit fc18cd2db6
9 changed files with 81 additions and 34 deletions

View File

@ -1814,7 +1814,10 @@ static int build_argcv (
{
for (argc = 1, p = icf; *p; p++, argc++)
{
v_tmp = qse_awk_rtx_makestrvalwithstr (rtx, *p);
/* the argument must compose a numeric string if it can be.
* so call qse_awk_rtx_makenstrvalwithstr() instead of
* qse_awk_rtx_makestrvalwithstr(). */
v_tmp = qse_awk_rtx_makenstrvalwithstr (rtx, *p);
if (v_tmp == QSE_NULL)
{
qse_awk_rtx_refdownval (rtx, v_argv);
@ -1941,7 +1944,10 @@ static int __build_environ (
*eq = QSE_WT('=');
#endif
v_tmp = qse_awk_rtx_makestrvalwithstr (rtx, vptr);
/* the string in ENVIRON should be a numeric string if
* it can be converted to a number. call makenstrval()
* instead of makestrval() */
v_tmp = qse_awk_rtx_makenstrvalwithstr (rtx, vptr);
if (v_tmp == QSE_NULL)
{
#if ((defined(QSE_ENV_CHAR_IS_MCHAR) && defined(QSE_CHAR_IS_MCHAR)) || \