X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_tgoto.c;h=8e240856f823c99bb48e03cf58e3c858b39155ef;hb=3ef920d65fb2d4046096131d868ae8d4bba79d46;hp=31daf443624f4405709a348650a5024c41b4cdd2;hpb=8b06e371ed1bce3dd6f37138e6becb5e1a562fe0;p=ncurses.git diff --git a/ncurses/tinfo/lib_tgoto.c b/ncurses/tinfo/lib_tgoto.c index 31daf443..8e240856 100644 --- a/ncurses/tinfo/lib_tgoto.c +++ b/ncurses/tinfo/lib_tgoto.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 2000-2008,2012 Free Software Foundation, Inc. * + * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2000-2008,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,7 +36,7 @@ #include #include -MODULE_ID("$Id: lib_tgoto.c,v 1.16 2012/02/24 02:08:08 tom Exp $") +MODULE_ID("$Id: lib_tgoto.c,v 1.19 2020/02/02 23:34:34 tom Exp $") #if !PURE_TERMINFO static bool @@ -125,7 +126,14 @@ tgoto_internal(const char *string, int x, int y) *value += 1; need_BC = TRUE; } else { - *value = 0200; /* tputs will treat this as \0 */ + /* tputs will pretend this is \0, which will almost + * always work since ANSI-compatible terminals ignore + * the character. ECMA-48 does not document a C1 + * control for this value. A few (obsolete) terminals + * can use this value in special cases, such as cursor + * addressing using single-byte coordinates. + */ + *value = 0200; } } result[used++] = (char) *value++; @@ -199,6 +207,6 @@ tgoto(const char *string, int x, int y) result = tgoto_internal(string, x, y); else #endif - result = TPARM_2((NCURSES_CONST char *) string, y, x); + result = TPARM_2(string, y, x); returnPtr(result); }