Commit 2f7f39b4 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Keyboard.c: Fix and simplify keyboard config file handling

keyboard config file for nxagent/x2goagent was broken from the moment it got implemented. nxagentXkbConfigFilePath had never been filled.
parent 8793e362
...@@ -871,8 +871,6 @@ XkbError: ...@@ -871,8 +871,6 @@ XkbError:
FILE *file; FILE *file;
XkbConfigRtrnRec config; XkbConfigRtrnRec config;
int nxagentXkbConfigFilePathSize;
char *nxagentXkbConfigFilePath; char *nxagentXkbConfigFilePath;
XkbComponentNamesRec names; XkbComponentNamesRec names;
...@@ -1019,22 +1017,15 @@ XkbError: ...@@ -1019,22 +1017,15 @@ XkbError:
XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb);
if (nxagentX2go) if (nxagentX2go)
nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_X2GO); nxagentXkbConfigFilePath = strdup(XKB_CONFIG_FILE_X2GO);
else else
nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_NX); nxagentXkbConfigFilePath = strdup(XKB_CONFIG_FILE_NX);
nxagentXkbConfigFilePath = malloc((nxagentXkbConfigFilePathSize + 1) * sizeof(char));
if ( nxagentXkbConfigFilePath == NULL) if (nxagentXkbConfigFilePath == NULL)
{ {
FatalError("nxagentKeyboardProc: malloc failed."); FatalError("nxagentKeyboardProc: malloc failed.");
} }
if (nxagentX2go)
nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_X2GO);
else
nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE_NX);
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentKeyboardProc: nxagentXkbConfigFilePath [%s].\n", fprintf(stderr, "nxagentKeyboardProc: nxagentXkbConfigFilePath [%s].\n",
nxagentXkbConfigFilePath); nxagentXkbConfigFilePath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment