aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nxcomp/src/ChannelEndPoint.cpp6
-rw-r--r--nxcomp/src/Loop.cpp6
2 files changed, 8 insertions, 4 deletions
diff --git a/nxcomp/src/ChannelEndPoint.cpp b/nxcomp/src/ChannelEndPoint.cpp
index 7768df137..635dd1ac7 100644
--- a/nxcomp/src/ChannelEndPoint.cpp
+++ b/nxcomp/src/ChannelEndPoint.cpp
@@ -209,8 +209,6 @@ ChannelEndPoint::getUnixPath(char **unixPath) const {
if (unixPath)
*unixPath = NULL;
- else
- return false;
long p;
char *path = NULL;
@@ -230,7 +228,9 @@ ChannelEndPoint::getUnixPath(char **unixPath) const {
return false;
}
- *unixPath = strdup(path);
+ // Only return value wanted
+ if ( unixPath )
+ *unixPath = strdup(path);
return true;
}
diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp
index ddffcd1ca..8e6f20efb 100644
--- a/nxcomp/src/Loop.cpp
+++ b/nxcomp/src/Loop.cpp
@@ -7803,6 +7803,7 @@ int ParseEnvironmentOptions(const char *env, int force)
strcpy(opts, env);
char *nextOpts = opts;
+ bool nxdisplay_found = false;
//
// Ensure that DISPLAY environment variable
@@ -7824,14 +7825,17 @@ int ParseEnvironmentOptions(const char *env, int force)
else if (strncasecmp(opts, "nx/nx,", 6) == 0)
{
nextOpts += 6;
+ nxdisplay_found = true;
}
else if (strncasecmp(opts, "nx,", 3) == 0)
{
nextOpts += 3;
+ nxdisplay_found = true;
}
else if (strncasecmp(opts, "nx:", 3) == 0)
{
nextOpts += 3;
+ nxdisplay_found = true;
}
else if (force == 0)
{
@@ -7860,7 +7864,7 @@ int ParseEnvironmentOptions(const char *env, int force)
value = strrchr(nextOpts, ':');
- if (value != NULL)
+ if (value != NULL && nxdisplay_found )
{
char *check = value + 1;