Commit Graph

66 Commits

Author SHA1 Message Date
Patrick Georgi ae001c320f fix misleading indentation
Mostly to shut up the compiler, but some real bugs hidden in there.
2025-12-18 22:58:26 +01:00
hyousatsu f0123efa84 Fix some warnings. 2024-07-21 00:43:27 +00:00
Patrick Georgi d8a43c0b49 DtTerm/TermPrim: check pointer before traversing 2024-01-05 18:44:19 -07:00
Patrick Georgi c48ec3adff lib/DtTerm: Remove dead assignments, initializations and increments
This shouldn't change behavior (or even object code) at all because
those assignments are all without effect. Removing that code removes
noise which helps working with code analysis tools.
2024-01-05 18:44:19 -07:00
Patrick Georgi e2aa3e665b DtTerm/TermPrimUtil: Use mkstemp instead of mktemp 2024-01-03 22:51:58 +01:00
Patrick Georgi 9dca44513c DtTerm/TermPrimUtil: Use 6 'X's in mktemp template
Some implementations (e.g. glibc) require that, while implementations
that are fine with 5 of them still work the same (just with one more
constant letter)
2024-01-03 22:51:50 +01:00
hyousatsu d500c61527 DtTerm: fix a segfault by allocating a string dynamically. 2023-01-12 15:07:20 +00:00
Jon Trulson 2d0c4d6d39 Kill off OSMAJORVERSION and OSMINORVERSION defines/cpp flags
This has meant very little for a long time as configure.ac just
hardcoded these values depending on the current OS versions at the
time.

The only place where this is really 'needed' is XlationSvc.c in DtSvc
so that differences between locale specifications on various versions
of an OS can be accounted for. So for now, we just define those when
building DtSvc.

We could probably safely remove them as well with an update to the
Xlate locale DB to remove ancient cruft we don't care about anymore.

For various other modules, like dtlogin, dtsession, etc we just use
the code that was already being used due to the hardcoded values we've
had for the last 10-ish years.
2022-08-06 17:57:44 -06:00
Chase 45cee195bd Generify source code
Previously we would fail in some parts of the code if we did not have a
premade configuration, now we use any code that was marked as Linux, BSD and
Solaris as our basis in order to support building unknown Unix systems.
2022-08-06 11:31:51 -06:00
Chase 06863e826e lib/DtTerm/TermPrim: clean up defines 2022-08-06 11:31:50 -06:00
Chase edf4319548 Discontinue HPUX support 2022-07-23 17:49:33 -06:00
Peter Howkins fa4fe1fb47 libdtterm: Resolve uninitialized warnings 2021-12-24 10:50:28 -07:00
Jon Trulson e10d06f210 configure/Makefiles: add checks for Xmu, Xext, and Xdmcp
We also remove sun pro specific options, and do some general cleanup
as well as remove hardcoded library refs like -lXm, -lXext, etc...
2021-12-21 16:42:22 -07:00
Liang Chang b816b85575 DtTerm: enable post-process output. 2021-12-03 22:10:57 +09:00
Jon Trulson 5223d0408e lib/DtTerm: fix implicit-function-declaration warnings 2021-11-12 16:14:18 -07:00
OBATA Akio 16fe76ed65 Fix to include system header files for using functions 2021-10-08 14:40:56 +09:00
Jon Trulson 2730367844 utempter: complete the implementation
Liang Chang added utempter support to the dtterm widget in
pre-autoconf CDE.  While the code itself was merged, it was still not
"turned on" for autoconf builds.

This commit completes the implementation allowing dtterm on Linux and
the BSDs to be installed without having to be setuid root -- as long
as the libutempter headers and libraries are installed.
2021-07-04 16:45:57 -06:00
Jon Trulson 369b3e89d9 Begin removal of some Imakefiles, and other no longer useful cruft
This commit will not completely remove all Imake files, specifically
those for sections that have not been completed yet.

Also, the databases dir has been moved to databases-delete-later until
we have everything building and installed properly.
2021-07-03 18:23:40 -06:00
Liang Chang ba1c6bf810 DtTerm: Add libutempter support for utmp/wtmp updates. 2021-06-02 19:56:30 -06:00
Liang Chang 82d4a8bb68 DtTerm: Add pts driver support. 2021-06-02 19:56:30 -06:00
Lev Kujawski a6ea2a2d52 Centralize catgets() calls through MsgCat
CDE has relied upon catgets() implementations following a relaxed
interpretation of the XPG internationalization standard that ignored
-1, the standard error value returned by catopen, as the catalog
argument. However, this same behavior causes segmentation faults with
the musl C library.

This patch:

- Centralizes (with the exception of ToolTalk) all calls to catopen(),
  catgets(), and catclose() through MsgCat within the DtSvc library.
- Prevents calls to catgets() and catclose() that rely upon
  undefined behavior.
- Eliminates a number of bespoke catgets() wrappers, including multiple
  redundant caching implementations designed to work around a design
  peculiarity in HP/UX.
- Eases building CDE without XPG internationalization support by providing
  the appropriate macros.
2021-06-02 19:55:15 -06:00
Jon Trulson c3d7858424 DtTerm: make it build 2019-10-26 16:34:29 -06:00
Jon Trulson 369308b737 The great includes migration of 2019 (autotools)
Ok - so one of the steps in building CDE is an early phase called the
includes phase (make includes).  At this point, all of the public
header files are exported to exports/include/Dt, DtI, ...

Then, the software is built using that include dir.

This of course does not work in autotools.  Much of the software does
things like #include <Dt/something.h>, so in order for the build to
succeed, this behavior must be represented/replicated in some way.

It seems the usual way of dealing with this is to place all public
headers (and in some projects, ALL headers) into a toplevel include
directory.

We now do this for all public headers - they have been moved from
wherever they were and placed in the appropriate spot in includes/

This will break the Imake 'make includes' phase unless the Imakefiles
are fixed (remove the HEADERS = stuff, and the incdir defines).  This
has not been done at this point since in reality, once autotools works
properly, there will be no need for the Imake stuff anymore, and I
intend to get rid of it.

This is just a warning for now - Imake builds in this tree will now
fail at the 'includes' stage.

This commit is only the migration.  In upcoming commits, libtt will be
fixed so that the hack being used before to get around this problem is
removed as there will no longer be any need.

And then the autotools work continues...
2019-10-25 17:01:34 -06:00
Chase eb907bd68c lib/DtTerm: add automake files 2019-10-23 15:34:20 -06:00
wmoxam 923951b414 Remove NOTDONE code 2019-10-14 11:57:41 -06:00
chase dd68514e4f Remove hpversion.h from repository
This patch removes hpversion.h from the repository, this also untangles a
lot of ifdef mess. This closes bug CDExc19524.
2018-10-06 17:00:38 -06:00
chase 90a2b2848a remove ultrix support 2018-09-30 17:27:04 -06:00
Peter Howkins 6b09b19351 libDtTerm: Change to ANSI function definition 2018-06-28 04:01:19 +01:00
chase 809c3d8bb6 Spelling fixes 2018-05-31 22:23:19 -06:00
Ulrich Wilkens 297b6bd845 Fix warnings on FreeBSD 2018-05-31 22:04:08 -06:00
Jon Trulson 77cdabb8f6 TermPrimSetUtmp: fix lost define broken by last patch 2018-05-24 18:52:53 -06:00
chase 4f5e7fe5e3 Use POSIX macros for linux 2018-05-24 18:22:55 -06:00
chase 164e695cd0 remove OSF1 support 2018-05-24 14:25:26 -06:00
chase 07900bd93b Remove Unixware and openserver support 2018-05-20 12:13:07 -06:00
chase 8a4f389634 Remove UXPDS support 2018-05-15 20:27:22 -06:00
chase 33d2749ea3 Last of the spelling fixed 2018-04-28 12:36:44 -06:00
chase 1fe5a550b2 Fix typo in license headers 2018-04-28 12:30:20 -06:00
Peter Howkins ccab0597ed libdtterm: Resolve coverity issues 2018-04-04 19:48:23 +01:00
Douglas Carmichael ecdf9eba10 Changed memcpy() to memmove() to stop coredumping on OpenBSD 5.7. 2015-06-21 17:07:41 -06:00
Stuart Brady 0306c7c6f2 DtTerm: fix formatted text in history buffer
Formatted text currently gets corrupted by DtTerm when copied into its
history buffer.

As soon as a line of text is copied into the history, the text of each
segment of formatted text is altered so that it contains the text from
the start of the line.  For example:

    echo -e '\e[1mbold\e[m \e[4munderlined\e[m'

When the text has scrolled off the screen, scrolling back to it reveals:

    boldbbold under

This is fixed by adding the calls to _DtTermPrimBufferGetCharacterPointer
that were missing which would update the buffer pointer when inserting
text into the history buffer.
2015-05-05 16:47:05 -06:00
Jon Trulson 50de34a933 DtTerm: Coverity (memory corruption, moderate) 2014-12-26 15:59:52 -07:00
Jon Trulson cedb47114f DtTerm: Coverity (memory corruption, moderate) 2014-12-26 15:58:50 -07:00
Jon Trulson b0548ce111 DtTerm: Coverity (memory corruption) 2014-12-26 14:08:24 -07:00
Ulrich Wilkens 29294e0373 Fix FreeBSD 10.1 build 2014-11-20 17:48:57 -07:00
Ulrich Wilkens 01d6c363fa OpenIndiana and Solaris port 2014-10-28 13:40:11 -06:00
Ulrich Wilkens c3f74eec17 FreeBSD 10 clang port 2014-07-27 12:32:35 -06:00
Eugene Doudine 4e2adc1f8e Fixes the bug, which caused dtterm to show stripes of wrong color between text lines when using fontsets that include fonts of slightly different heights.
The cause of the bug was that X*DrawImageString draws background
according to the extents of the given string, not to extents of the font set,
which determine terminal line height.

Now, when such a situation is detected, the background is cleared before
drawing the characters.
2014-05-03 22:11:41 -06:00
Ulrich Wilkens d24fd29b52 Fix dtfile and dtterm on NetBSD 2014-03-11 13:06:55 -06:00
Jon Trulson b147e0ce12 libDtTerm: add include <stdio.h> so FILE is properly defined.
TermPrim/TermPrimDebug.h references FILE without including the
required header file.  I am not sure why this hasn't shown up before.
2014-03-09 00:21:40 -07:00
Ulrich Wilkens 6b0da8f335 Introduction of BSDArchitecture 2013-10-20 16:23:40 -06:00