X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_has_cap.c;h=17e59d5351734266ad433f07d9a6eb211bc8f5f2;hp=a501453f2f79d1423568d768c1746d97712ce823;hb=ef2d99350e0d3e4606171b5b1466ab92ec440205;hpb=78e49873c69dc0494bb34c62f897f8b446584a33 diff --git a/ncurses/tinfo/lib_has_cap.c b/ncurses/tinfo/lib_has_cap.c index a501453f..17e59d53 100644 --- a/ncurses/tinfo/lib_has_cap.c +++ b/ncurses/tinfo/lib_has_cap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2013 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 * @@ -42,18 +42,26 @@ #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_has_cap.c,v 1.5 2009/02/15 00:47:12 tom Exp $") +MODULE_ID("$Id: lib_has_cap.c,v 1.10 2013/11/16 19:57:22 tom Exp $") NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (NCURSES_SP_DCL0) { - T((T_CALLED("has_ic()"))); - returnCode(cur_term && - (insert_character || parm_ich - || (enter_insert_mode && exit_insert_mode)) - && (delete_character || parm_dch)); + bool code = FALSE; + + T((T_CALLED("has_ic(%p)"), (void *) SP_PARM)); + + if (HasTInfoTerminal(SP_PARM)) { + code = ((insert_character || parm_ich + || (enter_insert_mode && exit_insert_mode)) + && (delete_character || parm_dch)) ? TRUE : FALSE; + } + + returnCode(code); } #if NCURSES_SP_FUNCS @@ -67,10 +75,14 @@ has_ic(void) NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_il) (NCURSES_SP_DCL0) { - T((T_CALLED("has_il()"))); - returnCode(cur_term - && (insert_line || parm_insert_line) - && (delete_line || parm_delete_line)); + bool code = FALSE; + T((T_CALLED("has_il(%p)"), (void *) SP_PARM)); + if (HasTInfoTerminal(SP_PARM)) { + code = ((insert_line || parm_insert_line) + && (delete_line || parm_delete_line)) ? TRUE : FALSE; + } + + returnCode(code); } #if NCURSES_SP_FUNCS