X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_tgoto.c;h=084a322fe95c8a05fdb26dd0d272d2b2c6f2cc62;hb=eb51b1ea1f75a0ec17c9c5937cb28df1e8eeec56;hp=9cf5e100ce87ff7abd3c90b0bdc15084e54b2f35;hpb=59a39f19a7f7feeff4af587a289a2ad7966947fe;p=ncurses.git diff --git a/ncurses/tinfo/lib_tgoto.c b/ncurses/tinfo/lib_tgoto.c index 9cf5e100..084a322f 100644 --- a/ncurses/tinfo/lib_tgoto.c +++ b/ncurses/tinfo/lib_tgoto.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2023 Thomas E. Dickey * * Copyright 2000-2008,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -36,7 +36,7 @@ #include #include -MODULE_ID("$Id: lib_tgoto.c,v 1.21 2020/05/27 23:55:56 tom Exp $") +MODULE_ID("$Id: lib_tgoto.c,v 1.22 2023/04/08 13:48:58 tom Exp $") #if !PURE_TERMINFO static bool @@ -207,6 +207,14 @@ tgoto(const char *string, int x, int y) result = tgoto_internal(string, x, y); else #endif - result = TIPARM_2(string, y, x); + if ((result = TIPARM_2(string, y, x)) == NULL) { + /* + * Because termcap did not provide a more general solution such as + * tparm(), it was necessary to handle single-parameter capabilities + * using tgoto(). The internal _nc_tiparm() function returns a NULL + * for that case; retry for the single-parameter case. + */ + result = TIPARM_1(string, y); + } returnPtr(result); }