esc
Externally Scriptable Editor
git clone git://mccd.space/esc
| Log | Files | Refs | README |
commit 952201d38d04972ab545e077dade8c0ffac76588 parent c15b85a79ab0b8082f821448aac1dbfddf93a9c8 Author: Marc Coquand <marc@coquand.email> Date: Tue, 24 Feb 2026 16:17:06 +0100 Don't strip newline Diffstat:
| M | unix_utils.c | | | 6 | ++---- |
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/unix_utils.c b/unix_utils.c
@@ -25,12 +25,10 @@ char *unix_select_command(void) {
char *line = NULL;
size_t len = 0;
- if (getline(&line, &len, pipe) != -1) {
- line[strcspn(line, "\n")] = 0; // Strip newline
- } else {
+ if (getline(&line, &len, pipe) == -1) {
free(line);
line = NULL;
- }
+ }
pclose(pipe);
return line;
}