aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Args.c7
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Init.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c
index cdcde1224..949892f25 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -40,6 +40,7 @@ is" without express or implied warranty.
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <libgen.h>
#ifdef __sun
#include <strings.h>
@@ -125,7 +126,7 @@ extern int _XGetBitsPerPixel(Display *dpy, int depth);
extern char dispatchExceptionAtReset;
-const char *nxagentProgName;
+char *nxagentProgName;
char nxagentDisplayName[NXAGENTDISPLAYNAMELENGTH];
Bool nxagentSynchronize = False;
@@ -188,7 +189,9 @@ int ddxProcessArgument(int argc, char *argv[], int i)
* Ensure that the options are set to their defaults.
*/
- nxagentProgName = argv[0];
+ char *basec = strdup(argv[0]);
+ nxagentProgName = strdup(basename(basec));
+ free(basec);
/*
* Check if we running as X2Go Agent
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c
index 01acbbc16..d95c4b70f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Init.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c
@@ -194,7 +194,7 @@ int nxagentX2go;
void checkX2goAgent(void)
{
- extern const char *nxagentProgName;
+ extern char *nxagentProgName;
if( strcasecmp(nxagentProgName,"x2goagent") == 0)
{
fprintf(stderr, "\nrunning as X2Go Agent\n");