aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-05-09 20:31:35 +0300
committerArnold D. Robbins <arnold@skeeve.com>2012-05-09 20:31:35 +0300
commita59319732d89feda419acab674ea580c95db7d4a (patch)
tree3d30595e8f50cb1b486c9f61f93a498834c22842 /eval.c
parent8ff0b4eaa7592280b5a55087c0326c6ef1f88db5 (diff)
parentc41908d0b02f7746a67ab7aa2e54058e5b66439a (diff)
downloadegawk-a59319732d89feda419acab674ea580c95db7d4a.tar.gz
egawk-a59319732d89feda419acab674ea580c95db7d4a.tar.bz2
egawk-a59319732d89feda419acab674ea580c95db7d4a.zip
Merge branch 'xgawk'
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 2305bbb3..d3e38f03 100644
--- a/eval.c
+++ b/eval.c
@@ -988,10 +988,10 @@ set_TEXTDOMAIN()
*/
}
-/* update_ERRNO_saved --- update the value of ERRNO based on argument */
+/* update_ERRNO_int --- update the value of ERRNO based on argument */
void
-update_ERRNO_saved(int errcode)
+update_ERRNO_int(int errcode)
{
char *cp;
@@ -1004,12 +1004,24 @@ update_ERRNO_saved(int errcode)
ERRNO_node->var_value = make_string(cp, strlen(cp));
}
-/* update_ERRNO --- update the value of ERRNO based on errno */
+/* update_ERRNO_string --- update ERRNO with optionally translated string */
void
-update_ERRNO()
+update_ERRNO_string(const char *string, enum errno_translate translate)
{
- update_ERRNO_saved(errno);
+ if (translate == TRANSLATE)
+ string = gettext(string);
+ unref(ERRNO_node->var_value);
+ ERRNO_node->var_value = make_string(string, strlen(string));
+}
+
+/* unset_ERRNO --- eliminate the value of ERRNO */
+
+void
+unset_ERRNO(void)
+{
+ unref(ERRNO_node->var_value);
+ ERRNO_node->var_value = dupnode(Nnull_string);
}
/* update_NR --- update the value of NR */