diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-01-14 22:53:23 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-01-14 22:53:23 +0000 |
commit | c41efa71283b98a8b67da1f025518ffcba73d562 (patch) | |
tree | fb0237199c05ef549121e81f64701da4cfd57738 | |
parent | 4fae72fbe227311eae86baa97678fa0d8047ba20 (diff) |
Restore an if that got lost in the update.
Fixes problems with editors/joe reported by benoit@.
-rw-r--r-- | lib/libcurses/tinfo/lib_tgoto.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/libcurses/tinfo/lib_tgoto.c b/lib/libcurses/tinfo/lib_tgoto.c index 536771fd17e..887cb8f5f5b 100644 --- a/lib/libcurses/tinfo/lib_tgoto.c +++ b/lib/libcurses/tinfo/lib_tgoto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tgoto.c,v 1.5 2010/01/12 23:22:06 nicm Exp $ */ +/* $OpenBSD: lib_tgoto.c,v 1.6 2010/01/14 22:53:22 nicm Exp $ */ /**************************************************************************** * Copyright (c) 2000-2006,2008 Free Software Foundation, Inc. * @@ -37,7 +37,7 @@ #include <ctype.h> #include <termcap.h> -MODULE_ID("$Id: lib_tgoto.c,v 1.5 2010/01/12 23:22:06 nicm Exp $") +MODULE_ID("$Id: lib_tgoto.c,v 1.6 2010/01/14 22:53:22 nicm Exp $") #if !PURE_TERMINFO static bool @@ -176,11 +176,13 @@ tgoto_internal(const char *string, int x, int y) string++; } if (result != 0) { - copied = strlcpy(result + used, BC, length - used); - if (copied < length - used) - used += copied; - else - used += length - used - 1; + if (need_BC) { + copied = strlcpy(result + used, BC, length - used); + if (copied < length - used) + used += copied; + else + used += length - used - 1; + } result[used] = '\0'; } return result; |