summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-05-01Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
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-10-16Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
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>
2020-04-25Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
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-17Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
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-07-15Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
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-11-25Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
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-11-07Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
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-08-08Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
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>
2015-03-28Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
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-11-02Merge fixMatthieu Herrb
2013-11-02Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
Conflicts: src/session.c src/util.c
2013-08-18Replace malloc(strlen()+1); strcpy(); pairs with strdup()Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>