summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-11-28Fix spelling/wording issuesAlan Coopersmith
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-06-21quiet a misleading warning in grammarThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-21issue #8: twm displays all windows as "Untitled"Thomas E. Dickey
adapt the suggestion to use XFetchName to work around a system whose locale support is broken, but rather than break existing configurations, use that call as a fallback when the existing/working calls fail. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-21X11R5 change lost the update for yylineno needed to make parse messagesThomas E. Dickey
useful; a subsequent X11R6 change made the behavior a little worse. This change repairs that old damage. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-21include twm.h in header files which rely upon its definitionsThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-21indent lex/yacc files using xxx-indent (twm-indent uses GNU indent, whichThomas E. Dickey
does not handle those files). Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-21add/use new function parseWarning, which honors -v/-q optionsThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-20make the "-V" version print less cluttered (and more like most programs)Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-19use new warning-message functions in the remaining places where suitable,Thomas E. Dickey
since -q option can be used to silence those if wanted Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-19add/use functions to make warning messages more consistently use the program ↵Thomas E. Dickey
name as a prefix Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-18fix the cppcheck style- and format-warningsThomas E. Dickey
also bump version to 1.0.11.1, reflecting ongoing work since release Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-17allow most options to be long/abbreviatable for consistency,Thomas E. Dickey
and document (except for the print-extension) all of the options Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-17add "-V" version-messageThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-17eliminate some unnecessary(?) goto statementsThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-16eliminate a fixed-size buffer in Execute() function.Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-06-15issue #1: twm random window placement handles large windows poorlyThomas E. Dickey
report/patch by Preston Crow for improved window placement (reindented to fit with current sources) Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-11-23an error in the action for warp-to-ring would produce two error messagesThomas E. Dickey
because the case lacked a break-statement Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-11-23strict gcc-warning fixes, no object-changeThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-11-23whitespace-fixesThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-11-23Formatted most of the C files using "twm-indent", part of cindent atThomas E. Dickey
https://invisible-island.net/cindent/ That is essentially a script which adds typedefs to the x-indent.sh script. No object-code changed in this reformatting. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-07-16issue 2: twm doesn't handle RandR screen size changesThomas E. Dickey
patch submitted by Preston Crow modified to check if xrandr development header/library is available Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-07-16caddr_t used to be used in X code before XPointer was established; it's ↵Thomas E. Dickey
obsolete and less portable Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-07-16issue 4: twm makes windows too wideThomas E. Dickey
https://gitlab.freedesktop.org/xorg/app/twm/issues/4 patch submitted by Jes Bodi Klinke Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-07-16fix const-warnings by making a copy of the dataThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-07-16fix const-warnings in grammar using a non-const initializerThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-07-16constify deftwmrc[], to fix gcc-stricter warningsThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-07-16gcc-stricter warnings, no object changeThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-07-15fix gcc-normal compiler warnings, no object changeThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-07-15issue 7: check if there are no fonts found for the fontset, and fallback to ↵Thomas E. Dickey
fixed in that case. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-31Make some char pointers const as necessary to clear some gcc warningsAlan Coopersmith
twm.c:544:20: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] Scr->iconmgr.name = "TWM"; ^ twm.c:545:25: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] Scr->iconmgr.icon_name = "Icons"; Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-03-03Read system.twmrc from where it got installedBryan Kadzban
${rcdir} is ${datadir}/X11/twm by default, but can be overridden when running make. If it is overridden, then the code should read from the same place as where "make rcdir=FOO install" puts the file. (Obviously overriding rcdir= for "make install" requires overriding it for "make" as well. But at least this way it's possible to get it to work. :-) ) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-09-30If we can't find a colormap to replace, insert new one instead of leaking itAlan Coopersmith
Found by Oracle's Parfait 2.2 static analyzer: Error: Memory leak Memory leak [memory-leak] (CWE 401): Memory leak of pointer sc allocated with malloc(32) at line 421 of src/util.c in function 'InsertRGBColormap'. sc allocated at line 397 with malloc(32) sc leaks when replace != 0 at line 405. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-09-30When replacing a colormap, free old map, not new oneAlan Coopersmith
Found by Oracle's Parfait 2.2 static analyzer: Error: Use after free Use after free [use-after-free] (CWE 416): Use after free of pointer Scr at line 421 of src/util.c in function 'InsertRGBColormap'. Invalid pointer accessible via global Scr at line 105 of src/twm.c maps escapes to sc->maps at line 419 of src/util.c in function 'InsertRGBColormap' maps freed with XFree at line 406 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-09-28Adapt callers to ExpandFilename change.Thomas Klausner
It now always allocates memory, so remove some unnecessary checks. While here, improve handling of an error case. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-09-28Add some const.Christos Zoulas
Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-07-19Do not try to extend the font-pattern with a wild-card.Michael van Elst
This will almost always select the wrong fontset and use wrong metrics. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-12-31Remove custom version of system(3c) for SolarisAlan Coopersmith
Was originally added in 1993 with the comment: make f.exec do the right thing to get working xterms under Solaris2. Doesn't seem to be needed any more on modern Solaris. As a bonus, gets rid of error found by Oracle Parfait 1.5.1 that if the execl() call fails, the function falls through and returns an uninitialized value for status and then both parent & child go back to running the same code. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-12-31Only use results from GetWindowProperty if it returned successAlan Coopersmith
Since Xlib prior to 1.6 didn't always clear values on failure, don't assume they're safe to use unless we succeeded. Reported by Oracle Parfait 1.5.1: Error: Uninitialised memory (CWE 456) Possible access to uninitialised memory '&nPixels' at line 963 of src/parse.c in function 'put_pixel_on_root'. &nPixels allocated at line 953. Possible access to uninitialised memory '&retProp' at line 962 of src/parse.c in function 'put_pixel_on_root'. &retProp allocated at line 954. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-18Replace malloc(strlen()+1); strcpy(); pairs with strdup()Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-18AddWindow: Use NULL instead of 0 for null pointer checkAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-18Stop casting return values from malloc & callocAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-18Stop casting pointers to (char *) when freeing themAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-31Delete trailing whitespace in non *.[ch] source filesAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-31Make more functions static that aren't called from other filesAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-31Assume C89 signal handlers, returning voidAlan Coopersmith
Removes old #ifdef SIGNALRETURNSINT check that was never defined in autoconf builds, only old Imake builds. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-31Make some more previously global variables into file-scoped staticsAlan Coopersmith
Not used from other source files, so no need to export them Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-31Remove unused global variable gotFirstSaveAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-31unifdef macII - drop support for A/UX 2.0Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-31Make various helper & callback functions private to session.cAlan Coopersmith
Nothing else ever called them, so no reason to export them. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: <wharms@bfs.de>
2013-07-31Convert remaining K&R function declarations to C89 styleAlan Coopersmith
Many existing function declarations were C89, and headers all use C89 prototypes, but a few function declarations had been left in the old style. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: <wharms@bfs.de>