=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/usr.bin/tmux/tty.c 2009/06/27 12:57:14 1.8 +++ src/usr.bin/tmux/tty.c 2009/07/07 17:24:32 1.9 @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.8 2009/06/27 12:57:14 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.9 2009/07/07 17:24:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -76,7 +76,7 @@ tty_init(struct tty *tty, char *path, char *term) { tty->path = xstrdup(path); - if (term == NULL) + if (term == NULL || *term == '\0') tty->termname = xstrdup("unknown"); else tty->termname = xstrdup(term); @@ -98,7 +98,7 @@ if ((mode = fcntl(tty->fd, F_GETFL)) == -1) fatal("fcntl failed"); if (fcntl(tty->fd, F_SETFL, mode|O_NONBLOCK) == -1) - fatal("fcntl failedo"); + fatal("fcntl failed"); if (fcntl(tty->fd, F_SETFD, FD_CLOEXEC) == -1) fatal("fcntl failed");