aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-12-16 21:06:07 +0200
committerArnold D. Robbins <arnold@skeeve.com>2010-12-16 21:06:07 +0200
commitd587d4e5a72d08926d36288663a92ca6efbe0a6b (patch)
treebc0ca68333c11f7c56d4c6894b1a725ff707e4c8 /main.c
parentedfb721ac785219e9b881d8ac3a841cef8270a79 (diff)
downloadegawk-d587d4e5a72d08926d36288663a92ca6efbe0a6b.tar.gz
egawk-d587d4e5a72d08926d36288663a92ca6efbe0a6b.tar.bz2
egawk-d587d4e5a72d08926d36288663a92ca6efbe0a6b.zip
Add PROCINFO["strftime"] as default strftime() format.
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/main.c b/main.c
index e62e74d4..b7fb5b4d 100644
--- a/main.c
+++ b/main.c
@@ -171,6 +171,8 @@ const int gawk_mb_cur_max = 1;
FILE *output_fp;
int output_is_tty = FALSE; /* control flushing of output */
+const char def_strftime_format[] = "%a %b %e %H:%M:%S %Z %Y";
+
extern const char *version_string;
#if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0
@@ -1056,6 +1058,9 @@ load_procinfo()
PROCINFO_node = install_symbol(estrdup("PROCINFO", 8),
mk_symbol(Node_var_array, (NODE *) NULL));
+ update_PROCINFO_str("version", VERSION);
+ update_PROCINFO_str("strftime", def_strftime_format);
+
#ifdef GETPGRP_VOID
#define getpgrp_arg() /* nothing */
#else
@@ -1065,15 +1070,12 @@ load_procinfo()
value = getpgrp(getpgrp_arg());
update_PROCINFO_num("pgrpid", value);
-
/*
- * could put a lot of this into a table, but then there's
- * portability problems declaring all the functions. so just
- * do it the slow and stupid way. sigh.
+ * Could put a lot of this into a table, but then there's
+ * portability problems declaring all the functions. So just
+ * do it the slow and stupid way. Sigh.
*/
- update_PROCINFO_str("version", VERSION);
-
value = getpid();
update_PROCINFO_num("pid", value);