Commit graph

1178 commits

Author SHA1 Message Date
walter harms
602d7f5030 libX11: rm redundante NULL checks
This patch removes the last remaining  NULL checks for Xfree()

Signed-off-by: Harms <wharms@bfs,de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-17 10:54:16 +10:00
walter harms
d81fed4614 Remove more redundant null checks before Xfree()
Signed-off-by: Harms <wharms@bfs,de>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-06-06 17:24:39 -07:00
walter harms
0b7fd7dbec Remove redundant null checks before free
This patch removes some redundant null checks before free.
It should not change the code otherwise. Be aware that this
is only the first series.

Signed-off-by: Harms <wharms@bfs,de>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-06-06 17:16:40 -07:00
walter harms
7d452fad50 libX11/lcUTF8.c fix: dereferenced before check
* Do not use variables before checked for NULL.

Signed-off-by: Harms <wharms@bfs,de>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-06-06 17:05:58 -07:00
walter harms
a3808f5151 libX11/XKBNames.c fix: dereferenced before check
* Do not use variables before checked for NULL.

Signed-off-by: Harms <wharms@bfs,de>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-06-06 17:05:58 -07:00
walter harms
b3c9f6a17e libX11/lcGenConv.c fix: dereferenced before check
* Do not use variables before checked for NULL.

Signed-off-by: Harms <wharms@bfs,de>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-06-06 17:05:55 -07:00
Andreas Schwab
c6bc28d433 Restore lost tabs in sed commands
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-05-23 17:27:10 -07:00
Benno Schulenberg
e3dc0d1733 nls: Transform Brazilian compose file to an include plus three overrides.
Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-05-21 10:05:14 -04:00
Benno Schulenberg
16c87dda4d nls: Adding the missing compose sequences with <comma> for O with ogonek.
All other vowels with ogoneks can already be composed using <comma>.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-05-21 10:05:14 -04:00
Benno Schulenberg
655b60f483 nls: Adding the missing postfix sequences for composing vowels with ogoneks.
It existed for lowercase i, but not for uppercase I nor the other vowels.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-05-21 10:05:14 -04:00
Owen W. Taylor
7f8f9a36ef Fix XNextRequest() after direct usage of XCB
When XCB owns the X socket, dpy->request is not updated, so
NextRequest() and XNextRequest() return the wrong value. There's
nothing we can do to fix NextRequest() while retaining ABI compat,
but change XNextRequest() to grab the socket back from XCB,
updating dpy->request.

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-05-20 21:33:24 -07:00
Alan Coopersmith
0f9e734ea9 Add missing .TE tags to end tables in Xkb man pages
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-05-20 21:30:57 -07:00
Alan Coopersmith
280274e529 XCreateGC.man: simplify table to work with Solaris tbl
Having every table cell be a text diversion (T{...T}) was too much for
Solaris tbl to handle, and thus "man XCreateGC" would print the error
/usr/man/man3x11/XCreateGC.3x11: line 402: Too many text block diversions
tbl quits
and not display the table of mask bits or any text in the man page after
that table.   Since the #define column doesn't need special handling,
making it not use text diversions brings the table under the tbl limit.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-05-20 21:30:57 -07:00
James Cloos
93bb325a54 Revert "nls: Adding compose sequences (with <parenleft> first) that GTK also has."
Parenleft is already in use for sequences of the form <(> <letter> <)>
to generate circled letters.

Eg, <Multikey> <parenleft> <a> <parenright> generates ⓐ.

This reverts commit f020235f4b.

Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-05-20 17:30:10 -04:00
Benno Schulenberg
060707851b nls: Adding accessible compose sequences for Ș and Ț (with comma below).
Compose sequences with <dead_belowcomma> exist, but very few keyboard
layouts contain that symbol.  So a more usual character is needed to be
able to easily compose Ș, ș, Ț and ț.  The semicolon is normally only
used for composing letters with ogoneks -- but only vowels take ogoneks,
so the character is free for consonants, and thus <semicolon> is used
here to compose commas below.  It is somewhat fitting, because on most
Romanian keyboards the Ș is placed on that key, and the Ț next to it.

(Oh -- the more obvious sequences with <comma> were already taken for
composing S and T with cedillas.)

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-05-20 17:22:19 -04:00
Benno Schulenberg
ca435c2f75 nls: Ordering some compose sequences in a more customary way.
The custom seems to be: pairing the ones that have only the sequence of
two keys reversed, and putting the one with the diacritic first first.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-05-20 15:07:43 -04:00
Benno Schulenberg
f020235f4b nls: Adding compose sequences (with <parenleft> first) that GTK also has.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-05-20 15:07:33 -04:00
Benno Schulenberg
bda0b3b5bd nls: Allowing Romanian Ă and ă to be composed also with lowercase <u>.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-05-20 15:06:57 -04:00
Alan Coopersmith
8be4610939 Fix "follwing" typo in en_US.UTF-8/Compose comment
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-03-13 23:22:48 -07:00
Reuben Thomas
6f30e9034f en_US.UTF-8/Compose: Fix apparent copy-paste-o, changing capital to small A.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-03-13 23:07:35 -07:00
Peter Hutterer
d6bd988bc0 man: fix man page for XkbGetMap
Returned structure must be freed with XkbFreeKeyboard().

Reported-by: Morten Bøgeskov <mb@dbc.dk>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03 12:41:08 +10:00
Ran Benita
a6dcf2201a Remove dead USE_OWN_COMPOSE-protected code
The build doesn't provide any way to define this option. It also refers
to files (imComp.h) and functions (e.g. XimCompInitTables(),
XimCompProcessSym()) which are not found anywhere, and the ordinary
Compose implementation in xim doesn't use any of it.

Signed-off-by: Ran Benita <ran234@gmail.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-02-16 17:05:55 -08:00
Ran Benita
b64bee2ddb
nls: always use XCOMM instead of # for comments in Compose.pre files
Lines starting with # are considered as preprocessor directives in the
.pre files.

Fixes warnings like:
<stdin>:3:0: error: invalid preprocessing directive #Khmer

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-02-16 19:29:21 -05:00
Alan Coopersmith
470e2289a3 Fix typos in Xrm.c comments
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-02-06 13:48:08 -08:00
Marko Myllynen
aacf95dacc
Annotate Finnish Compose map with Unicode code points
Scripted annotation, no functional changes.

Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-01-29 13:28:41 -05:00
Teemu Likonen
20fdccd81b
Fix "RING ABOVE" key in the Finnish compose file
The Finnish keyboard standard defines that <dead_abovering> <space> must
insert the character U+02DA RING ABOVE. Currently the Finnish Compose
file inserts U+00B0 DEGREE SIGN even though the line's comment says
"RING ABOVE". This commit changes the character to U+02DA RING ABOVE.

Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-01-29 13:27:37 -05:00
Ran Benita
8757e2ac8e
nls: remove duplicate 'ohorn' and 'uhorn' compose sequences
Since <Ohorn> == <U01A0> and <ohorn> == <U01A1>, when translated to
keysyms:

 #define XK_Ohorn                      0x10001a0  /* U+01A0 LATIN CAPITAL LETTER O WITH HORN */
 #define XK_ohorn                      0x10001a1  /* U+01A1 LATIN SMALL LETTER O WITH HORN */

(and similarly for uhorn), there is no need to have both names. Remove
the unicode literal ones.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: James Cloos <cloos@jhcloos.com>
2014-01-29 12:32:05 -05:00
Alan Coopersmith
b98998cb3b Add RANDR 1.4 requests & events to XErrorDB
Checked against randrproto.txt & randr.h

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-01-18 22:35:18 -08:00
Alan Coopersmith
321392ded1 Remove unused ETEST & ESZTEST macros from XlibInt.c
Left behind when 15e5eaf628 removed support for building without XCB.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2014-01-05 10:27:54 -08:00
Alan Coopersmith
1ffc0c5503 _XkbReadGeomOverlay: check for NULL first, then use pointer
Flagged by cppcheck 1.62:
[lib/libX11/src/xkb/XKBGeom.c:479] -> [lib/libX11/src/xkb/XKBGeom.c:480]:
 (warning) Possible null pointer dereference: row - otherwise it is
 redundant to check it against null.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-12-26 09:26:13 -08:00
Alan Coopersmith
ddf5f130cc XkbSelectEventDetails: remove unnecessary assignments
clear & selectAll are set to 0 already a few lines earlier,
affectWhich is set to XkbMapNotifyMask a few lines later.
None are used between the other assignments and the removed ones.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-12-26 09:22:49 -08:00
Jon TURNEY
3d69b0a83e Don't try so hard to find a matching font with the given encoding
See http://sourceware.org/bugzilla/show_bug.cgi?id=10948

Currently, if the locale is UTF-8, no CJK fonts are installed, and someone
does XCreateFontSet() with a font name of "*", we end up asking the server
to list the (non-existent) fonts 11 times for each CJK encoding, which can
take a while.

A * wildcard can match multiple components in a XLFD name in XListFonts(),
so there's no need to try adding more than one to get a match.

We do try once with a leading '*-' in case the fontname isn't a full
well-formed XLFD name, maybe even that isn't needed?

(See also http://invisible-island.net/xterm/xterm.faq.html#slow_menus)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-12-13 22:27:08 -08:00
Alan Coopersmith
7e16330073 unifdef -UISC
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-12-02 21:51:27 -08:00
Benno Schulenberg
1e43c262d1 nls: Fix transposed locale identifier for Khmer.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-11-22 22:46:23 -08:00
Alan Coopersmith
0e45f64766 Drop X_LOCALE fallback for OS'es without setlocale()
C89 or bust!   This was documented as being needed for "only Lynx,
Linux-libc5, OS/2" and has never been enabled in modular builds,
since none of those platforms have had anyone step up to add support
since the X11R7 conversion to autotools.

Mostly performed with unifdef -UX_LOCALE, followed by removal of files
left without any purpose, and manual cleanup of remaining references.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-22 22:02:17 -08:00
Alan Coopersmith
6cb02b1663 Xcms file parsing should not require the impossible to succeed
The field2 helper function, to split lines from Xcms.txt files into
two tab delimited fields, contained a check:

    if ((*pBuf != '\n') || (*pBuf != '\0')) {
        return(XcmsFailure);

which would cause it to return failure unless *pBuf had a value that
was simultaneously equal to both \n & \0, and no one wants to live in
a world where that could ever be true.

This has gone unnoticed since 1991, since this only caused lines
in Xcms.txt that started with whitespace to be rejected, but now
gcc -Wlogicalop has brought it to our attention, and
https://bugs.freedesktop.org/show_bug.cgi?id=70803 was filed.

Now that we see it, and cannot unsee it, we change it to use the
same logic as the check at other points in this function, to return
failure only if we hit \n or \0 before we find the first non-whitespace
character, so that lines starting with whitespace will have the space
skipped over to get to the color name to be defined.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2013-10-25 09:27:37 -07:00
Gaetan Nadon
18a5278b00 makekeys: don't need to use target-specific CFLAGS
It's the only thing built in that directory, so we can use AM_CFLAGS
and AM_CPPFLAGS as usual.

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-09-30 13:24:04 -04:00
James Cloos
5dcb40f28d
nls/en_US.UTF-8/Compose.pre: Fix typo.
Fix typo added in 215ce6a678, s/actute/acute/.

Fixes bug #69476.  Reported by Jean Krohn.

Signed-off-by: James Cloos <cloos@jhcloos.com>
2013-09-17 12:50:42 -04:00
Alan Coopersmith
cb107760df libX11 1.6.2 2013-09-08 18:37:12 -07:00
Benno Schulenberg
215ce6a678
nls: Adding more accessible compose sequences for J́ and j́.
Few keyboards have an <acute> key, so this adds the much more
accessible and usual compose sequences with <apostrophe>, ánd
the most comfortable ones with <dead_acute>.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: James Cloos <cloos@jhcloos.com>
2013-09-01 18:28:50 -04:00
Alan Coopersmith
e9b14d10d0 Bug 68413 - [Bisected]Error in `xterm': realloc(): invalid next size
Pass *new* size to realloc, not old size.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-24 17:27:43 -07:00
Alan Coopersmith
c2b8e30790 Stop checking for HAVE_DIX_CONFIG_H on the client side
Leftover from when these XKB files were shared with the server sources
and could be compiled in either the client or server, with the different
autoconf config files in each.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-20 12:51:10 -07:00
Alan Coopersmith
84276609b2 Rearrange some variable declarations & initializations in XKB
Little things noticed during XKB restyling that seemed to make the
code easier to read.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-20 12:51:10 -07:00
Alan Coopersmith
b90b7e859c Reindent XKB code to X.Org standard style
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-20 12:51:10 -07:00
Alan Coopersmith
c0a0f78eb4 Fix overflow checks in _XkbReadKeySyms when key_sym_map is already created
We were checking to make sure that the largest keysym value was within
the range of the allocated buffer, but checking against different limits
in the not-yet-allocated vs. the already-allocated branches.

The check should be the same in both, and reflect the size used for the
allocation, which is based on the maximum key code value, so we move it
to be a common check, before we branch, instead of duplicating in each
branch.

map->key_sym_map is an array of XkbSymMapRec structs, [0..max_key_code]
map->syms is the array for which num_syms is recorded, hence is not the
right value to check for ensuring our key_sym_map accesses are in range.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reported-by: Barry Kauler <bkauler@gmail.com>
Tested-by: Barry Kauler <bkauler@gmail.com>
2013-08-20 12:51:10 -07:00
Alan Coopersmith
bea6cbd027 Remove long unused src/udcInf.c
I can find no record of what this file was for.  Neither the X11R6.8.2
monolith Imakefile nor any modular release Makefile.am have ever built
it and nothing else references it.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-20 12:51:09 -07:00
Alan Coopersmith
bf3501e039 Remove unnecessary casts of pointers to (char *) in calls to Xfree()
Left one cast behind that is necessary to change from const char *
to char * in src/xlibi18n/lcCharSet.c.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-20 12:51:09 -07:00
Alan Coopersmith
6ead9dd92a Don't cast sizeof() results to unsigned when passing to Xmalloc/Xcalloc
sizeof() returns size_t, malloc() & calloc() expect sizes in size_t,
don't strip down to unsigned int and re-expand unnecessarily.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-20 12:51:09 -07:00
Alan Coopersmith
25a7a329de Remove even more casts of return values from Xmalloc/Xrealloc
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-20 12:51:09 -07:00
Alan Coopersmith
f8fa16092a xlibi18n: fix argsize argument to _XlcParsePath
The array is defined as having NUM_LOCALEDIR entries, so use that
instead of hardcoded 256 value (the other two calls already did this).

Reported by parfait:
   Buffer overflow (CWE 120): In pointer dereference of argv[argc] with index argc
      Pointer size is 64 elements (of 8 bytes each), index is 255
        at line 82 of src/xlibi18n/lcFile.c in function 'parse_line'.
        called at line 178 in function '_XlcParsePath' with argv = argv.
        called at line 722 in function '_XlcLocaleLibDirName' with argv = args, argsize = 256.
        at line 82 of src/xlibi18n/lcFile.c in function 'parse_line'.
        called at line 178 in function '_XlcParsePath' with argv = argv.
        called at line 638 in function '_XlcLocaleDirName' with argv = args, argsize = 256.

[ This bug was found by the Parfait 1.2.0 bug checking tool.
  http://labs.oracle.com/pls/apex/f?p=labs:49:::::P49_PROJECT_ID:13 ]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-20 12:51:09 -07:00