diff options
author | James Booth <boothj5@gmail.com> | 2015-01-15 01:31:23 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-01-15 01:31:23 +0000 |
commit | 6beeec03d4612dd7edf032b673d2a4179e852896 (patch) | |
tree | 62105bc82ca6d3c88187193f2efadf61532eeba5 /src/ui | |
parent | 78bfd8da40007a47794a48f1a2b00deaebd89c1a (diff) | |
parent | 40f91de7a3090f40657fb4be9ba8ca1c41257480 (diff) | |
download | profani-tty-6beeec03d4612dd7edf032b673d2a4179e852896.tar.gz |
Merge branch 'master' into inp-utf8
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/core.c | 8 | ||||
-rw-r--r-- | src/ui/ui.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/ui/core.c b/src/ui/core.c index 6918a658..50fa8539 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -174,7 +174,7 @@ ui_close(void) endwin(); } -wint_t +gboolean ui_get_char(char *input, int *size) { int result = 0; @@ -193,7 +193,11 @@ ui_get_char(char *input, int *size) ui_input_nonblocking(FALSE); } - return ch; + if (ch == '\n') { + input[*size++] = '\0'; + } + + return (ch != '\n'); } void diff --git a/src/ui/ui.h b/src/ui/ui.h index 1e78ce40..a482826b 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -229,7 +229,7 @@ void ui_update_presence(const resource_presence_t resource_presence, void ui_about(void); void ui_statusbar_new(const int win); -wint_t ui_get_char(char *input, int *size); +gboolean ui_get_char(char *input, int *size); void ui_input_clear(void); void ui_input_nonblocking(gboolean); void ui_replace_input(char *input, const char * const new_input, int *size); |