From 3f7b3001988bf921e6cd860f03a6256b1451ee3d Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 24 Jul 2017 23:45:48 +0200 Subject: treat options parameter as option string if it starts with nx/nx This way one can easily pass options to nxagent run as Xnest replacement without having to create a temporary options file. Please note that it is not of much use for normal sessions. Options passed like this cannot be changed after startup so a reconnect may not work as expected. Fixes ArcticaProject/nx-libs#476 --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index d5cbfbce3..e4fa350bc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -285,7 +285,22 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (nxagentOptionsFilename) { - nxagentProcessOptionsFile(); + /* if the "filename" starts with an nx marker treat it + as an option _string_ instead of a filename */ + if (strncasecmp(nxagentOptionsFilename, "nx/nx,", 6) == 0 || + strncasecmp(nxagentOptionsFilename, "nx/nx:", 6) == 0) + { + nxagentParseOptionString(nxagentOptionsFilename + 6); + } + else if (strncasecmp(nxagentOptionsFilename, "nx,", 3) == 0 || + strncasecmp(nxagentOptionsFilename, "nx:", 3) == 0) + { + nxagentParseOptionString(nxagentOptionsFilename + 3); + } + else + { + nxagentProcessOptionsFile(nxagentOptionsFilename); + } } } -- cgit v1.2.3