aboutsummaryrefslogtreecommitdiff
path: root/libxkbfile/src/maprules.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-10-07 08:43:18 +0000
committermarha <marha@users.sourceforge.net>2009-10-07 08:43:18 +0000
commitc73dc01b6de45612b24dc2dd34fba24d81ebf46c (patch)
tree50278a03a26262d5cc30244c65aeb31002c47cec /libxkbfile/src/maprules.c
parent77a4732b0637493966889fe3545966fdc12a1b5e (diff)
downloadvcxsrv-c73dc01b6de45612b24dc2dd34fba24d81ebf46c.tar.gz
vcxsrv-c73dc01b6de45612b24dc2dd34fba24d81ebf46c.tar.bz2
vcxsrv-c73dc01b6de45612b24dc2dd34fba24d81ebf46c.zip
Switched to following packages:
fixesproto-4.1.1 randrproto-1.3.1 libxkbfile-1.0.6
Diffstat (limited to 'libxkbfile/src/maprules.c')
-rw-r--r--libxkbfile/src/maprules.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libxkbfile/src/maprules.c b/libxkbfile/src/maprules.c
index ab164c6a2..104dad38e 100644
--- a/libxkbfile/src/maprules.c
+++ b/libxkbfile/src/maprules.c
@@ -137,6 +137,14 @@ InputLineAddChar(InputLine *line,int ch)
(int)((l)->line[(l)->num_line++]= (c)):\
InputLineAddChar(l,c))
+#ifdef HAVE_UNLOCKED_STDIO
+#undef getc
+#define getc(x) getc_unlocked(x)
+#else
+#define flockfile(x) do {} while (0)
+#define funlockfile(x) do {} while (0)
+#endif
+
static Bool
GetInputLine(FILE *file,InputLine *line,Bool checkbang)
{
@@ -144,6 +152,7 @@ int ch;
Bool endOfFile,spacePending,slashPending,inComment;
endOfFile= False;
+ flockfile(file);
while ((!endOfFile)&&(line->num_line==0)) {
spacePending= slashPending= inComment= False;
while (((ch=getc(file))!='\n')&&(ch!=EOF)) {
@@ -208,6 +217,7 @@ Bool endOfFile,spacePending,slashPending,inComment;
endOfFile= True;
/* else line->num_line++;*/
}
+ funlockfile(file);
if ((line->num_line==0)&&(endOfFile))
return False;
ADD_CHAR(line,'\0');
@@ -891,6 +901,7 @@ XkbRF_GetComponents( XkbRF_RulesPtr rules,
XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Append);
XkbRF_ApplyPartialMatches(rules, names);
XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Option);
+ XkbRF_ApplyPartialMatches(rules, names);
if (names->keycodes)
names->keycodes= XkbRF_SubstituteVars(names->keycodes, &mdefs);