aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-02-21 13:42:25 +0200
committerSergey Poznyakoff <gray@gnu.org>2016-02-21 13:42:25 +0200
commit599a468169078449b68e7c0ef711c14fb746f0ea (patch)
treec691d411a3cc3b9e00e8c1f4603575c878bfd48a
parent6aac230ce3d21f1e71333ec3863c7ea1afd051c3 (diff)
downloadpies-599a468169078449b68e7c0ef711c14fb746f0ea.tar.gz
pies-599a468169078449b68e7c0ef711c14fb746f0ea.tar.bz2
Bugfixes.
* src/pies.c (_cb_command,_cb_env): Free wordsplit struct. (main): Allocate log_tag. Otherwise it might get overwritten by mf_proctitle_format.
-rw-r--r--src/pies.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pies.c b/src/pies.c
index 33244ad..d1bcfd8 100644
--- a/src/pies.c
+++ b/src/pies.c
@@ -540,8 +540,8 @@ _cb_command (enum grecs_callback_command cmd,
grecs_error (locus, 0, "wordsplit: %s", strerror (errno));
return 1;
}
- comp->argc = ws.ws_wordc;
- comp->argv = ws.ws_wordv;
+ wordsplit_getwords (&ws, &comp->argc, &comp->argv);
+ wordsplit_free (&ws);
break;
case GRECS_TYPE_ARRAY:
@@ -582,6 +582,7 @@ _cb_env (enum grecs_callback_command cmd,
grecs_locus_t *locus,
void *varptr, grecs_value_t *value, void *cb_data)
{
+ size_t argc;
char **argv;
char ***penv = varptr;
struct wordsplit ws;
@@ -594,9 +595,8 @@ _cb_env (enum grecs_callback_command cmd,
grecs_error (locus, 0, "wordsplit: %s", strerror (errno));
return 1;
}
- argv = ws.ws_wordv;
- ws.ws_wordc = 0;
- ws.ws_wordv = NULL;
+ wordsplit_getwords (&ws, &argc, &argv);
+ wordsplit_free (&ws);
break;
case GRECS_TYPE_ARRAY:
@@ -2075,7 +2075,7 @@ main (int argc, char **argv)
instance++;
}
setenv ("PIES_INSTANCE", instance, 1);
- log_tag = instance;
+ log_tag = grecs_strdup (instance);
if (!init_process)
set_conf_file_names (instance);

Return to:

Send suggestions and report system problems to the System administrator.