From b5cc3c94ed0de2d657edc2e5a95fd10e9db3c0a7 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 25 Oct 2016 22:53:39 +0200 Subject: Keyboard.c: improve keyboard file creation Fixes ArcticaProject/nx-libs#239 --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nx-X11/programs/Xserver/hw') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 2779e0470..1eca33665 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -1841,15 +1841,15 @@ void nxagentKeycodeConversionSetup(void) strcat(keyboard_file_path, "/keyboard"); if ((keyboard_file = fopen(keyboard_file_path, "w")) != NULL) { if ( drules != NULL ) - fprintf(keyboard_file, "rules=%s\n", drules); + fprintf(keyboard_file, "rules=\"%s\"\n", drules[0] == '\0' ? "," : drules); if ( dmodel != NULL ) - fprintf(keyboard_file, "model=%s\n", dmodel); + fprintf(keyboard_file, "model=\"%s\"\n", dmodel[0] == '\0' ? "," : dmodel); if ( dlayout != NULL ) - fprintf(keyboard_file, "layout=%s\n", dlayout); + fprintf(keyboard_file, "layout=\"%s\"\n", dlayout[0] == '\0' ? "," : dlayout); if ( dvariant != NULL ) - fprintf(keyboard_file, "variant=%s\n", dvariant); + fprintf(keyboard_file, "variant=\"%s\"\n", dvariant[0] == '\0' ? "," : dvariant); if ( doptions != NULL ) - fprintf(keyboard_file, "options=%s\n", doptions); + fprintf(keyboard_file, "options=\"%s\"\n", doptions[0] == '\0' ? "," : doptions); fclose(keyboard_file); fprintf(stderr, "keyboard file created\n"); } -- cgit v1.2.3