Commit Graph

157 Commits

Author SHA1 Message Date
roy ca57f21848 Correct terminfo variable pkey_norm to plab_norm. 2017-01-12 13:53:11 +00:00
roy 53035e70de Fix some off by one issues with arraycount ..thanks coypu. 2017-01-11 20:53:52 +00:00
christos ee97ae6abf off-by-one in memcpy. Found by ASAN (Carsten Kunze)
XXX: pullup 7.
2016-11-24 17:09:55 +00:00
christos 8b22ec00d4 - if we are freeing cur_term, set it to NULL.
- preserve and free "last" properly.

$ cat foo.c
#include <stdio.h>
#include <termcap.h>

int
main(void)
{
	tgetent(NULL, "dumb");
	tgetent(NULL, "network");
	tgetflag("so");
	return 0;
}
$ cc foo.c -lterminfo
$ MALLOC_OPTIONS=J ./a.out
Boom.

XXX: pullup-7
2016-04-01 19:59:08 +00:00
christos f5cb16e708 Always copy the area buffer, even when the length was the same
(from Rin Okuyama)
2015-11-26 01:03:22 +00:00
christos f464a786c5 From PR/50092:
- handle calling _ti_readterm with an existing initialized terminal
- simplify free code
Also:
- fix an inconsistency in userdefs count computation
2015-11-25 19:13:49 +00:00
christos 30fc0caf54 We have the max length; use snprintf. 2015-11-25 18:46:59 +00:00
christos db71acfd71 PR/50092: Rin Okuyama: Fix memory leak. 2015-11-25 18:46:24 +00:00
christos 7ddef8633d PR/50092: Fix memory leak. 2015-11-25 18:38:21 +00:00
christos e804370940 fix ti_puts prototype 2015-11-23 22:35:28 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
joerg 2786173415 Use an empty string, not a null pointer for nullname. 2013-11-18 20:51:03 +00:00
wiz a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
roy 1535311f47 Whitespace 2013-06-07 13:16:18 +00:00
njoly 40b41484a6 Fix c&p error in string descriptions. 2013-03-15 14:27:41 +00:00
roy 40e555b80b Provide a disabled implentation of tlparm and ti_tlparm for completeness.
This also improves the readability of _ti_tiparm.
2013-01-25 17:28:50 +00:00
roy 943df88df1 Add descriptions for terminfo keys to term.h
These are extracted by genman and placed into the compiled terminfo.5
Fixes PR lib/47090
2013-01-25 12:52:45 +00:00
roy 57755c0fa8 For platforms where we cannot fit a char * into a long, return NULL
and set errno to ENOTSUPP.
2013-01-25 12:30:05 +00:00
roy b05cdd2b82 Fix building our terminals with a non standard NETBSDSRCDIR, PR lib/46793.
Thanks to Bernd Ernesti.
2013-01-24 14:17:40 +00:00
roy a17592c001 Move the strings vs long analysis to a private function, but allow
tput(1) to use it so we can work with string parameters to capabilities.
2013-01-24 10:41:28 +00:00
roy 77e0da2e1e As tparm accepts longs we should treat them as long during expansion.
Also, fix the ~ and ! logic.
2013-01-24 10:28:28 +00:00
roy cf892bbeee Fix %t logic and don't output any %; or %e parts.
Fixes PR lib/47490 thanks to Julien Oster
2013-01-23 13:06:18 +00:00
msaitoh f1f8803538 Fix off by one error. 2012-11-30 10:14:18 +00:00
joerg 11b4a6201b Add tic dependency only for the USETOOLS case. 2012-08-20 15:44:02 +00:00
joerg 2f2f99b48a Relax consistency to make it possible to match valid entries. 2012-06-06 13:36:58 +00:00
wiz 1728003ef9 Bump date for previous. 2012-06-05 17:22:01 +00:00
joerg fc67b0cd11 Switch terminfo(3) to cdb(5). 2012-06-03 23:19:09 +00:00
roy b7ddb5da20 Ensure that we request a buffer big enough, although with the current
terminfo specification this should never happen.
Correctly return NULL when realloc(3) fails.
2012-06-02 19:10:33 +00:00
joerg 68a65e1a02 Fix a number of memory leaks. Keep final loop of the cleanup in tic(1)
under #ifdef __VALGRIND__ though.
2012-06-01 12:08:40 +00:00
joerg 5fafac093e Use memcmp in place of strncmp, since length is known to no longer than
either of the arguments.
2012-06-01 12:02:36 +00:00
dholland 6e357ed2e2 Add cdefs.h per PR 46492. 2012-05-29 00:27:59 +00:00
matt fa835e8c8b These directories default to WARNS?=5 2012-03-21 05:37:42 +00:00
christos 968af0c9f3 PR/46075: Asau: fix typo set_color_paid -> set_color_pair 2012-02-22 23:11:20 +00:00
joerg 93a30e6d6f Kill a bunch of manual __attribute__ usages and replace them with the
equivalent sys/cdefs.h invocation.
2011-11-28 12:44:18 +00:00
christos b9c2e08099 make use we don't touch memory past the end of the buffer. Pointed out
by tnozaki.
2011-11-13 15:24:04 +00:00
joerg 5b270365fe Fix dependencies on generated files. 2011-11-03 07:19:39 +00:00
yamt e2d8d702cb use the tools version of utilities for other scripts, too 2011-11-02 20:39:41 +00:00
christos 76151da247 use the tools version. 2011-11-02 20:30:00 +00:00
christos 474f83c4ae Separate the generators out, so that they can be re-used by tools, and
don't play games with curdir/objdir.
2011-11-02 17:48:53 +00:00
roy 9e5def586b Now that nbperf can generate the same file using the -p option,
there is no longer a need to store these files in CVS.
2011-11-02 12:09:25 +00:00
roy 62480e1c72 There is no standard way of getting a list of aliases for the
terminal. However, some applications such as telnet want to know this.
ncurses dumps the terminfo header into an undefined variable ttytype
and these applications then parse it to work out the aliases.
We should do the same for now, until a standard mechanism for getting
the information is available or the need for it goes away.
2011-10-05 10:46:08 +00:00
roy 64afaacce6 Move longname(3) from curses to terminfo, pre-cursor to fix PR/43386. 2011-10-04 11:01:13 +00:00
roy 2f9b6d37f2 Fix tparm.
As we now go via tiparm, store nums as int to conserve memory.
2011-10-03 20:13:48 +00:00
roy 91ab69b0df Remove _ti_freeterm as consumers should just use del_curterm. 2011-10-03 19:18:55 +00:00
roy 7fc83a7d87 Correct args 2011-10-03 19:15:03 +00:00
roy 44e794b040 Install correct man page links. 2011-10-03 13:10:58 +00:00
roy 39aae097d0 Correctly use ti_ instead of t_ for our extensions as per the man page.
Replace vtparm with tiparm.
tiparm is also non standard, but has been proposed at least.
2011-10-03 12:31:51 +00:00
roy fd2d10c6b0 Add termname(3) as defined by POSIX. 2011-10-02 19:24:25 +00:00
christos cc9ecc5e39 PR/45370: Takehiko NOZAKI: termcap emulation tget{flag,num,str} should
work with non-NUL terminated strings.
2011-09-16 18:51:44 +00:00
christos 5353040f23 document non-literal format strings 2011-08-16 10:35:03 +00:00
roy 3a520e5e78 Make new compiled terms for our updated terminfo. 2011-06-19 16:36:04 +00:00
roy ed684e08ea Clean up some compile warnings 2011-04-11 21:37:19 +00:00
roy 9a92225ded POSIX says that term.h should define tgetstr and friends
Fixes PR lib/43941
2011-04-11 21:13:09 +00:00
roy f42fd8d0f1 Simplify some conversion by usig pre formatted strings and a function
to print a parameter.
2011-03-18 10:42:54 +00:00
christos 50f9c0a390 OOPS has been reverted. 2011-03-14 11:44:20 +00:00
christos 29ba757a34 revert OOPS change now that most of the reasons for tgoto to return NULL
have been eliminated.
2011-03-11 13:28:52 +00:00
roy df504c6413 Do our best to process invalid terminfo strings instead of just
returning NULL.
2011-03-10 13:39:26 +00:00
roy 9d7b5f143f Fix two other off-by-one errors when processing %P and %g commands. 2011-03-10 10:46:33 +00:00
roy 40109496d4 Add support for translating the following termcap commands into terminfo:
%B %D %r %2 %3 %d %+ %> %.
Fixes PR bin/44692.
2011-03-10 10:17:19 +00:00
roy 74cdc55234 Fix an off-by-one error when processing embedded values. 2011-03-10 09:45:32 +00:00
christos 959ab2631c Restore historical behavior of tgoto() to return "OOPS" on failure. This is
best for now because there are too many programs that don't check the return
value of it. Of course cursor motion commands from $TERMCAP have 0 chance
of working now, since their % escapes are not translated to terminfo. In
the window case %+ expects one param from the stack in the termcap case
and two in the terminfo so we barf. We need proper captoinfo handling for
the % escapes, like the one in ncurses. Hi Roy :-)
2011-03-07 00:27:51 +00:00
christos f207e61c08 replace `` with $(). Hopefully with enough examples around people will
forget about ``.
2010-10-12 12:57:51 +00:00
christos e6dabc3c76 PR/43961: YAMAMOTO Takashi: uninitialized variable in termcap.c
Remove dead code.
2010-10-12 12:49:27 +00:00
roy 215c5976aa Our API just uses typedefs, so don't use the struct symbol which will avoid
any potential conflicts with userland.
2010-09-22 06:10:51 +00:00
mrg 4c92852a80 remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format.  ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k.  this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
  down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
2010-07-06 05:59:50 +00:00
roy 76cbf63f87 area is now used 2010-07-04 07:30:33 +00:00
roy 1f27d9b179 Convert padding for unknown capabilities as well. 2010-03-04 15:35:26 +00:00
roy 6855db0f30 Convert padding and give terminfo some default assumptions about termcap. 2010-03-04 15:16:39 +00:00
roy ca77b139e2 Abort an error. 2010-03-03 12:09:49 +00:00
roy 4b2d6106cf Use _ti_get_token instead of strsep when parsing termcap entries.
This allows us to handle \E\ as a valid sequence.
2010-03-02 14:11:11 +00:00
roy c6aefd4d60 Escape , when converting to terminfo. 2010-03-01 11:02:31 +00:00
dholland 5c7d0d1fb6 compile.c needs sys/endian.h; PR 42875 from Henning Petersen. 2010-03-01 01:59:48 +00:00
wiz 6d85ff35e1 '>' replacement for HTML output, be explicit about slash. 2010-02-26 07:03:49 +00:00
roy 007ba6f7e2 Implement captoinfo so that we can convert $TERMCAP into $TERMINFO.
We don't currently map %> %B %D.
That means no conversion for regent100, hz1500, act4, act5, mime terms.
2010-02-26 00:09:00 +00:00
roy 478e5b9ae4 If we only have a name then we flatten to an alias. 2010-02-25 23:44:02 +00:00
roy fde317d2b1 libterminfo can now compile a single terminfo description which allows
$TERMINFO to be a terminfo description as well as a file reference.

This enables the user to modify the terminfo description on read-only
media.
2010-02-22 23:05:39 +00:00
njoly 62fab5d4b7 Do clean generated terminfo.5 file. 2010-02-19 13:53:17 +00:00
roy 420f923a19 Store the generated compiled terminfo descriptions so that we can build
a consistent library just from source.
2010-02-12 12:18:33 +00:00
martin 33f9f146f2 Fix an array bounds check - fixes PR lib/42793.
Restore a comment (from libterm/tputs.c), requested by jdc.
2010-02-12 10:36:07 +00:00
roy c1a1881ef9 Don't try to map obsolete termcap bc and nl to terminfo. 2010-02-12 10:18:56 +00:00
wiz 6e41b81e29 Oxford serial comma. 2010-02-11 16:28:06 +00:00
roy 45b8382fe3 Include xterm. 2010-02-11 14:49:56 +00:00
roy 2680cfc1a1 Use $TOOL_TIC 2010-02-11 14:44:44 +00:00
roy b32b792e3b Respect TERMINFO_DIRS and document using an embedded database. 2010-02-11 14:36:09 +00:00
roy a2e27dcd47 Use structures so we know how long each description is. 2010-02-11 13:11:47 +00:00
roy 0c02e7a2e0 Allow a NULL description. 2010-02-11 09:42:03 +00:00
roy 1aacca65aa Remove silly debug. 2010-02-11 09:34:12 +00:00
roy 90cead5eeb Embed ansi, dumb, vt100, vt220 and wsvt25 compiled terminal descriptions
into libterminfo.
Constify some foo.
2010-02-11 00:27:09 +00:00
roy bf4a786d84 Correct date 2010-02-11 00:22:41 +00:00
roy 64c4b99ad2 We should always generate terminfo.5 to save human error syncing. 2010-02-09 22:16:12 +00:00
wiz 3d24ede313 Sync with terminfo(5): Remove /etc/terminfo.db. 2010-02-06 07:12:25 +00:00
roy 298c3fd52c Don't look in /etc for a terminfo database.
Don't report the rescue database if we did not find the terminal in
there AND we were able to access prior databases.
2010-02-05 19:21:02 +00:00
he 1c8b1eb3f5 More adaptation for ports with unsigned char as char. 2010-02-05 14:39:07 +00:00
roy ae351fab5b Store the aliases against the entry, so that infocmp can reproduce them.
Handy for creating smaller terminfo databases.
2010-02-05 12:31:56 +00:00
roy e0d0a8eecc Allow loading of a terminfo database in /rescue. 2010-02-05 09:42:21 +00:00
roy d8609d0687 Allow hash to be build on other hosts. 2010-02-04 12:25:08 +00:00
roy eedd9ade82 Fix build issues on other hosts. 2010-02-04 09:46:26 +00:00
roy c4a14cdcf2 Sync terminfo.5 changes into terminfo.5.in 2010-02-04 09:45:30 +00:00
wiz 69221deade More markup. 2010-02-04 09:12:55 +00:00
snj 51684bf8b3 Regenerate to pick up the changes from terminfo.5.in revision 1.3. 2010-02-03 21:02:39 +00:00