just 'print -c' outputs not even a newline; plug a memleak while here
This commit is contained in:
parent
2f63478bc9
commit
26689a7c81
13
funcs.c
13
funcs.c
@ -38,7 +38,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.314 2016/11/11 20:14:17 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.315 2016/11/11 20:53:15 tg Exp $");
|
||||||
|
|
||||||
#if HAVE_KILLPG
|
#if HAVE_KILLPG
|
||||||
/*
|
/*
|
||||||
@ -449,12 +449,17 @@ c_print(const char **wp)
|
|||||||
wp += builtin_opt.optind;
|
wp += builtin_opt.optind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (po.col) {
|
||||||
|
if (*wp == NULL)
|
||||||
|
return (0);
|
||||||
|
|
||||||
|
XPinit(words, 16);
|
||||||
|
}
|
||||||
|
|
||||||
Xinit(xs, xp, 128, ATEMP);
|
Xinit(xs, xp, 128, ATEMP);
|
||||||
|
|
||||||
if (*wp == NULL)
|
if (*wp == NULL)
|
||||||
goto print_no_arg;
|
goto print_no_arg;
|
||||||
if (po.col)
|
|
||||||
XPinit(words, 16);
|
|
||||||
print_read_arg:
|
print_read_arg:
|
||||||
if (po.chars) {
|
if (po.chars) {
|
||||||
while (*wp != NULL) {
|
while (*wp != NULL) {
|
||||||
@ -548,7 +553,6 @@ c_print(const char **wp)
|
|||||||
if (po.hist) {
|
if (po.hist) {
|
||||||
Xput(xs, xp, '\0');
|
Xput(xs, xp, '\0');
|
||||||
histsave(&source->line, Xstring(xs, xp), HIST_STORE, false);
|
histsave(&source->line, Xstring(xs, xp), HIST_STORE, false);
|
||||||
Xfree(xs, xp);
|
|
||||||
} else {
|
} else {
|
||||||
size_t len = Xlength(xs, xp);
|
size_t len = Xlength(xs, xp);
|
||||||
|
|
||||||
@ -588,6 +592,7 @@ c_print(const char **wp)
|
|||||||
if (po.copipe)
|
if (po.copipe)
|
||||||
restore_pipe();
|
restore_pipe();
|
||||||
}
|
}
|
||||||
|
Xfree(xs, xp);
|
||||||
|
|
||||||
return (c);
|
return (c);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user