From: Bruno Haible Date: Tue, 12 Dec 2006 14:17:15 +0000 (+0000) Subject: Make it work on BeOS. X-Git-Tag: v0.17~601 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98e5477bbf520138d06f1a3628c8dc5e97ab81fe;p=thirdparty%2Fgettext.git Make it work on BeOS. --- diff --git a/gnulib-local/ChangeLog b/gnulib-local/ChangeLog index 2b6a92e19..beed6dedc 100644 --- a/gnulib-local/ChangeLog +++ b/gnulib-local/ChangeLog @@ -1,3 +1,9 @@ +2006-12-11 Bruno Haible + + Portability to BeOS. + * lib/term-ostream.oo.c (term_ostream_create) [BeOS]: Correct the + values of stream->set_a_foreground and stream->set_a_background. + 2006-12-11 Bruno Haible Portability to systems with GNU termcap. diff --git a/gnulib-local/lib/term-ostream.oo.c b/gnulib-local/lib/term-ostream.oo.c index 6d1d469a3..e919cbe47 100644 --- a/gnulib-local/lib/term-ostream.oo.c +++ b/gnulib-local/lib/term-ostream.oo.c @@ -1717,6 +1717,24 @@ term_ostream_create (int fd, const char *filename) stream->enter_underline_mode = xstrdup0 (tgetstr ("us", NULL)); stream->exit_underline_mode = xstrdup0 (tgetstr ("ue", NULL)); stream->exit_attribute_mode = xstrdup0 (tgetstr ("me", NULL)); + +#ifdef __BEOS__ + /* The BeOS termcap entry for "beterm" is broken: For "AF" and "AB" it + contains balues in terminfo syntax but the system's tparam() function + understands only the termcap syntax. */ + if (stream->set_a_foreground != NULL + && strcmp (stream->set_a_foreground, "\033[3%p1%dm") == 0) + { + free (stream->set_a_foreground); + stream->set_a_foreground = xstrdup ("\033[3%dm"); + } + if (stream->set_a_background != NULL + && strcmp (stream->set_a_background, "\033[4%p1%dm") == 0) + { + free (stream->set_a_background); + stream->set_a_background = xstrdup ("\033[4%dm"); + } +#endif } /* Infer the capabilities. */