Prior to this, --enable-thread-safety-constructor would disable it,
while --disable worked as expected, and no option left it enabled as
expected by default. This also fixes the --help text to be displayed.
Fixes: afcdb6fb00
Reported-by: @igor.v.kovalenko
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
There is really no point in not being thread safe, I measured, all you
can see happen is noop performance gets like twice as slow and you have
thread safety bugs. And we're using xcb as the transport which means we
should expect threads in our clients anyway. Just do it.
This assumes your compiler understands __attribute__((constructor)). If
this is not your compiler, you can disable this with the appropriate
configure flag, but be aware you're asking for bugs.
Signed-off-by: Adam Jackson <ajax@redhat.com>
The Xserver made its own copy of this file in 2008, and the API's are
no longer the same between the server and client forks.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(Not that it will make any difference, as the checking of these
high bits looks like an excess of precaution.)
This fixes issue #134.
Reported-by: Rafał Mikrut
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
In the Ethiopian keyboard layout, the dead vowel keys do not produce <e>
and <u> and so on, but instead produce <U+FE69> and <U+FE75> and so on,
so the compose sequences should use those latter code points.
Also, include the basic compose sequences from en_US.UTF-8/Compose,
so that, when switching to a different layout in the Ethiopian locale,
all the usual compose sequences work too.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
These accents by themselves could only be produced when one had a
dead key for them, not with the help of the Multi key.
[Note that the sequences <dead_acute> <space> for apostrophe (')
and <dead_diaeresis> <space> for double quote (") are anomalies,
as normally <dead_accent> <space> produces the accent itself.]
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
Compose sequences are meant to produce certain symbols by combining
certain different symbols, not to produce a symbol with the help of
the symbol itself.
This fixes issue #59.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
The Khmer digraphs and Arabic ligatures have nothing to do with
Amharic or Greek.
(Also rewrap a comment and correct two others.)
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
XkbVirtualModsToReal should only fail to set mask if the server does
not support XKB, but it still made Oracle Parfait complain:
Error: Uninitialised memory
Uninitialised memory variable [uninitialised-mem-var] (CWE 457):
Possible access to uninitialised memory referenced by variable 'mask'
at line 863 of lib/libX11/src/xkb/XKBMisc.c in function 'XkbUpdateKeyTypeVirtualMods'.
Path in callee avoiding write at line 862
mask allocated at line 860
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This avoids a segfault during error-unwinding if an invalid display name
is passed to XOpenDisplay().
Fixes: 8a368d80 "Fix two memory leaks in _XFreeX11XCBStructure()"
Resolves: #155
Signed-off-by: Simon McVittie <smcv@debian.org>
Even when XCloseDisplay() was called, some memory was leaked.
XCloseDisplay() calls _XFreeDisplayStructure(), which calls
_XFreeX11XCBStructure().
However, _XFreeX11XCBStructure() did not destroy the condition variables,
resulting in the leaking of some 40 bytes.
Signed-off-by: Hodong <hodong@yozmos.com>
XInitThreads has been called if _Xglobal_lock != NULL, we may as well
check that before printing a misleading error message.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Request numbers are not always seen in the numeric order by widen(),
for example due to Mesa directly calling _XError(). When this happens,
widen() adds 2^32 to the reported widened number, triggering failed
assertions and bad behavior.
With this commit, wrapping of the lower dword is detected in a more
robust way, by requiring that a skip of at least 2^31 is seen.
This fixes issue #152.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
As the thing in the circle looks a bit like an upside-down Y,
use <O> <Y> as the sequence, similar to <O> <A> for anarchism.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
(These aliases may have been useful on some systems twenty years ago,
but nowadays all should have settled on lowercase language code plus
uppercase country code.)
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
There is no matching locale in the locale.dir and compose.dir files for
the locale eo.UTF-8. Setting it as the locale resulted in compose files
not being loaded.
Signed-off-by: iyzana <iyzana@protonmail.com>
Also, correct the comment for the double quote character ("), and move
the soft hyphen and the interrobangs to a special punctuation group.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
Using a misspelled abbreviation (CCCP) of an obsolete country's name
to compose a fairly general communist symbol does not seem right.
https://en.wikipedia.org/wiki/Hammer_and_sickle
Many compose sequences instead combine characters that together look
similar to the target character. Do the same here: question mark (?)
plus backslash (\) look a bit like ☭ .
In the bargain, this fixes issue #63.
Reported-by: Marc Mezzarobba
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
These sequences follow the logic of: the arrow shaft (=) first, the
arrow head (< or > or ^ or v) second. This is so because the sequence
<= is already taken for ≤, and there is no obvious ASCII character for
a double vertical line, so we have to make do with a horizontal one.
Since commit 6101b967b6 from eight years ago, there is a compose sequence
for the rightward double arrow, but not for the other three directions.
This fixes issue #138.
Requested-by: Mélanie Chauvel
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
It is possible for _XimICOfXICID() to return NULL, so it is necessary
to check this isn't actually the case before dereferencing the pointer.
All other callers of _XimICOfXICID() do this check too.
(The check itself is ugly, but it follows the style of the code in the
rest of the module.)
Fixes issue #45.
Reported-by: Bhavi Dhingra
Original-patch-by: Bhavi Dhingra
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
This achieves a more consistent vertical alignment (per group) of the
target character and the trailing comments.
(Most blocks were aligned in some fashion, except the "Greek Extended"
block, which has lines of greatly varying lengths.)
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
It was done with this script:
cat nls/en_US.UTF-8/Compose.pre |
sed 's!\(^<.\{6,13\}>\)\s*:!\1\t\t\t\t:!' |
sed 's!\(^<.\{14,21\}>\)\s*:!\1\t\t\t:!' |
sed 's!\(^<.\{22,29\}>\)\s*:!\1\t\t:!' |
sed 's!\(^<.\{30,37\}>\)\s*:!\1\t:!' |
sed 's!\(: ".*"\)\s*!\1\t!' |
sed 's!\(\s*# \)! # !' > trimmed &&
mv trimmed nls/en_US.UTF-8/Compose.pre
This saves 37 kilobytes of whitespace.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
This avoids pointlessly tumbling through several more ifs when the
conversion has aleady been done.
Also remove two redundant conditions (as lower codes have already
been handled) and fold two other conditions together.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
A few symbols, like Heta and Sampi and dotted lunate Sigma, have been
assigned code points since Unicode Data 4.0, and need their entries.
This fixes issue #132.
Reported-by: Ray Vine
Original-patch-by: Ray Vine
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
The 'if' at the beginning of _XkbHandleSpecialSym() allows only symbols
from the numeric keypad and some control symbols to pass -- XK_hyphen
is not among them, so the check for XK_hyphen in the later 'if' will
always be false.
(The corresponding conversion in _XTranslateKeySym() in KeyBind.c was
removed in March 1994.)
(Also, several keyboard layouts nowadays contain the 'hyphen' symbol,
allowing the user to enter soft hyphens into a document. So we really
don't want to remap this symbol.)
Fixes issue #48.
Reported-by: Bhavi Dhingra
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
The typo was only partially fixed in commit 22a5255b80 sixteen years ago,
and the internet shows that there was at least one user frustrated that
bg_BG.utf8 didn't work but bg_BG.UTF-8 did.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
Using this KP_Space symbol as a stand-in for the symbol 2 doesn't make
sense. It looks like a mistake, or as if someone had a broken keyboard
and used KP_Space as a substitute for 2.
Also, no keyboard layout in the last fifteen years has contained the
KP_Space symbol, so I don't see how anyone could type it.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
Also, align a few trailing comments more consistently, and change
some comments so they will be excluded from the installed file --
there is no need for those comments there.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>