aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-26 10:07:23 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-26 10:07:23 +0000
commit8b46e65aa3f057cd69aa5f58acbbdb735126c8c4 (patch)
treebfafaa326a83d925f43fb2351e462246587db964 /termkey.c
parentf9fe338e3ebfecc855dfd8a9b34e7ab3df4cd238 (diff)
downloadtermo-8b46e65aa3f057cd69aa5f58acbbdb735126c8c4.tar.gz
termo-8b46e65aa3f057cd69aa5f58acbbdb735126c8c4.tar.xz
termo-8b46e65aa3f057cd69aa5f58acbbdb735126c8c4.zip
Use termkey_set_flags() in constructor rather than copypasted logic
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/termkey.c b/termkey.c
index 7e5a473..1fadfb0 100644
--- a/termkey.c
+++ b/termkey.c
@@ -217,6 +217,8 @@ TermKey *termkey_new(int fd, int flags)
if(!tk)
return NULL;
+ tk->fd = fd;
+
if(!(flags & (TERMKEY_FLAG_RAW|TERMKEY_FLAG_UTF8))) {
int locale_is_utf8 = 0;
char *e;
@@ -236,11 +238,7 @@ TermKey *termkey_new(int fd, int flags)
flags |= TERMKEY_FLAG_RAW;
}
- tk->fd = fd;
- tk->flags = flags;
-
- if(flags & TERMKEY_FLAG_SPACESYMBOL)
- tk->canonflags |= TERMKEY_CANON_SPACESYMBOL;
+ termkey_set_flags(tk, flags);
tk->buffer = malloc(tk->buffsize);
if(!tk->buffer)