*** empty log message ***
This commit is contained in:
parent
f987802feb
commit
10d776577d
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: run.c,v 1.236 2006-10-16 08:47:59 bacon Exp $
|
* $Id: run.c,v 1.237 2006-10-16 09:11:53 bacon Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <xp/awk/awk_i.h>
|
#include <xp/awk/awk_i.h>
|
||||||
@ -252,6 +252,8 @@ int xp_awk_setglobal (xp_awk_run_t* run, xp_size_t idx, xp_awk_val_t* val)
|
|||||||
run, val, XP_AWK_VALTOSTR_CLEAR, XP_NULL, &convfmt_len);
|
run, val, XP_AWK_VALTOSTR_CLEAR, XP_NULL, &convfmt_len);
|
||||||
if (convfmt_ptr == XP_NULL) return -1;
|
if (convfmt_ptr == XP_NULL) return -1;
|
||||||
|
|
||||||
|
if (run->global.convfmt.ptr != XP_NULL)
|
||||||
|
XP_AWK_FREE (run->awk, run->global.convfmt.ptr);
|
||||||
run->global.convfmt.ptr = convfmt_ptr;
|
run->global.convfmt.ptr = convfmt_ptr;
|
||||||
run->global.convfmt.len = convfmt_len;
|
run->global.convfmt.len = convfmt_len;
|
||||||
}
|
}
|
||||||
@ -340,6 +342,8 @@ int xp_awk_setglobal (xp_awk_run_t* run, xp_size_t idx, xp_awk_val_t* val)
|
|||||||
run, val, XP_AWK_VALTOSTR_CLEAR, XP_NULL, &ofmt_len);
|
run, val, XP_AWK_VALTOSTR_CLEAR, XP_NULL, &ofmt_len);
|
||||||
if (ofmt_ptr == XP_NULL) return -1;
|
if (ofmt_ptr == XP_NULL) return -1;
|
||||||
|
|
||||||
|
if (run->global.ofmt.ptr != XP_NULL)
|
||||||
|
XP_AWK_FREE (run->awk, run->global.ofmt.ptr);
|
||||||
run->global.ofmt.ptr = ofmt_ptr;
|
run->global.ofmt.ptr = ofmt_ptr;
|
||||||
run->global.ofmt.len = ofmt_len;
|
run->global.ofmt.len = ofmt_len;
|
||||||
}
|
}
|
||||||
@ -352,6 +356,8 @@ int xp_awk_setglobal (xp_awk_run_t* run, xp_size_t idx, xp_awk_val_t* val)
|
|||||||
run, val, XP_AWK_VALTOSTR_CLEAR, XP_NULL, &ofs_len);
|
run, val, XP_AWK_VALTOSTR_CLEAR, XP_NULL, &ofs_len);
|
||||||
if (ofs_ptr == XP_NULL) return -1;
|
if (ofs_ptr == XP_NULL) return -1;
|
||||||
|
|
||||||
|
if (run->global.ofs.ptr != XP_NULL)
|
||||||
|
XP_AWK_FREE (run->awk, run->global.ofs.ptr);
|
||||||
run->global.ofs.ptr = ofs_ptr;
|
run->global.ofs.ptr = ofs_ptr;
|
||||||
run->global.ofs.len = ofs_len;
|
run->global.ofs.len = ofs_len;
|
||||||
}
|
}
|
||||||
@ -364,6 +370,8 @@ int xp_awk_setglobal (xp_awk_run_t* run, xp_size_t idx, xp_awk_val_t* val)
|
|||||||
run, val, XP_AWK_VALTOSTR_CLEAR, XP_NULL, &ors_len);
|
run, val, XP_AWK_VALTOSTR_CLEAR, XP_NULL, &ors_len);
|
||||||
if (ors_ptr == XP_NULL) return -1;
|
if (ors_ptr == XP_NULL) return -1;
|
||||||
|
|
||||||
|
if (run->global.ors.ptr != XP_NULL)
|
||||||
|
XP_AWK_FREE (run->awk, run->global.ors.ptr);
|
||||||
run->global.ors.ptr = ors_ptr;
|
run->global.ors.ptr = ors_ptr;
|
||||||
run->global.ors.len = ors_len;
|
run->global.ors.len = ors_len;
|
||||||
}
|
}
|
||||||
@ -421,6 +429,8 @@ int xp_awk_setglobal (xp_awk_run_t* run, xp_size_t idx, xp_awk_val_t* val)
|
|||||||
run, val, XP_AWK_VALTOSTR_CLEAR, XP_NULL, &subsep_len);
|
run, val, XP_AWK_VALTOSTR_CLEAR, XP_NULL, &subsep_len);
|
||||||
if (subsep_ptr == XP_NULL) return -1;
|
if (subsep_ptr == XP_NULL) return -1;
|
||||||
|
|
||||||
|
if (run->global.subsep.ptr != XP_NULL)
|
||||||
|
XP_AWK_FREE (run->awk, run->global.subsep.ptr);
|
||||||
run->global.subsep.ptr = subsep_ptr;
|
run->global.subsep.ptr = subsep_ptr;
|
||||||
run->global.subsep.len = subsep_len;
|
run->global.subsep.len = subsep_len;
|
||||||
}
|
}
|
||||||
@ -793,7 +803,7 @@ static int __build_runarg (xp_awk_run_t* run, xp_awk_runarg_t* runarg)
|
|||||||
if (v_tmp == XP_NULL)
|
if (v_tmp == XP_NULL)
|
||||||
{
|
{
|
||||||
xp_awk_refdownval (run, v_argv);
|
xp_awk_refdownval (run, v_argv);
|
||||||
run->errnum = XP_AWK_ENOMEM;
|
run->errnum = XP_AWK_ENOMEM;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: awk.c,v 1.98 2006-10-16 08:48:19 bacon Exp $
|
* $Id: awk.c,v 1.99 2006-10-16 09:11:53 bacon Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <xp/awk/awk.h>
|
#include <xp/awk/awk.h>
|
||||||
@ -772,8 +772,10 @@ static int __main (int argc, xp_char_t* argv[])
|
|||||||
runarg[0].len = xp_awk_strlen(runarg[0].ptr);
|
runarg[0].len = xp_awk_strlen(runarg[0].ptr);
|
||||||
runarg[1].ptr = XP_T("argumetn 1");
|
runarg[1].ptr = XP_T("argumetn 1");
|
||||||
runarg[1].len = xp_awk_strlen(runarg[1].ptr);
|
runarg[1].len = xp_awk_strlen(runarg[1].ptr);
|
||||||
runarg[2].ptr = XP_NULL;
|
runarg[2].ptr = XP_T("argumetn 2");
|
||||||
runarg[2].len = 0;
|
runarg[2].len = xp_awk_strlen(runarg[2].ptr);
|
||||||
|
runarg[3].ptr = XP_NULL;
|
||||||
|
runarg[3].len = 0;
|
||||||
|
|
||||||
if (xp_awk_run (awk, &runios, &runcbs, runarg) == -1)
|
if (xp_awk_run (awk, &runios, &runcbs, runarg) == -1)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user