Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
76ce623a
Commit
76ce623a
authored
Nov 18, 2017
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix options parsing on reconnect
Commit
3f7b3001
was incomplete: the options parameter was not parsed as a string on reconnect. It was always assumed to be a filename.
parent
39d45a0e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
36 deletions
+43
-36
Args.c
nx-X11/programs/Xserver/hw/nxagent/Args.c
+40
-34
Args.h
nx-X11/programs/Xserver/hw/nxagent/Args.h
+1
-0
Reconnect.c
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+2
-2
No files found.
nx-X11/programs/Xserver/hw/nxagent/Args.c
View file @
76ce623a
...
...
@@ -135,7 +135,7 @@ char nxagentShadowDisplayName[1024] = {0};
char
nxagentWindowName
[
256
];
char
nxagentDialogName
[
256
];
char
nxagentSessionId
[
256
]
=
{
0
};
char
*
nxagentOptionsFilename
;
char
*
nxagentOptionsFilename
OrString
;
Bool
nxagentFullGeneration
=
False
;
int
nxagentDefaultClass
=
TrueColor
;
...
...
@@ -259,18 +259,18 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
if
((
!
strcmp
(
argv
[
j
],
"-options"
)
||
!
strcmp
(
argv
[
j
],
"-option"
))
&&
j
+
1
<
argc
)
{
if
(
nxagentOptionsFilename
)
if
(
nxagentOptionsFilename
OrString
)
{
nxagentOptionsFilename
=
(
char
*
)
realloc
(
nxagentOptionsFilename
,
strlen
(
argv
[
j
+
1
])
+
1
);
nxagentOptionsFilename
OrString
=
(
char
*
)
realloc
(
nxagentOptionsFilenameOrString
,
strlen
(
argv
[
j
+
1
])
+
1
);
}
else
{
nxagentOptionsFilename
=
(
char
*
)
malloc
(
strlen
(
argv
[
j
+
1
])
+
1
);
nxagentOptionsFilename
OrString
=
(
char
*
)
malloc
(
strlen
(
argv
[
j
+
1
])
+
1
);
}
if
(
nxagentOptionsFilename
!=
NULL
)
if
(
nxagentOptionsFilename
OrString
!=
NULL
)
{
nxagentOptionsFilename
=
strcpy
(
nxagentOptionsFilename
,
argv
[
j
+
1
]);
nxagentOptionsFilename
OrString
=
strcpy
(
nxagentOptionsFilenameOrString
,
argv
[
j
+
1
]);
}
#ifdef WARNING
else
...
...
@@ -283,25 +283,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
}
}
if
(
nxagentOptionsFilename
)
{
/* 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
);
}
}
nxagentProcessOptions
(
nxagentOptionsFilenameOrString
);
}
if
(
!
strcmp
(
argv
[
i
],
"-B"
))
...
...
@@ -380,23 +362,19 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
int
size
;
if
(
nxagentOptionsFilename
!=
NULL
)
{
free
(
nxagentOptionsFilename
);
nxagentOptionsFilename
=
NULL
;
}
free
(
nxagentOptionsFilenameOrString
);
nxagentOptionsFilenameOrString
=
NULL
;
if
((
size
=
strlen
(
argv
[
i
]))
<
1024
)
{
if
((
nxagentOptionsFilename
=
malloc
(
size
+
1
))
==
NULL
)
if
((
nxagentOptionsFilename
OrString
=
malloc
(
size
+
1
))
==
NULL
)
{
FatalError
(
"malloc failed"
);
}
strncpy
(
nxagentOptionsFilename
,
argv
[
i
],
size
);
strncpy
(
nxagentOptionsFilename
OrString
,
argv
[
i
],
size
);
nxagentOptionsFilename
[
size
]
=
'\0'
;
nxagentOptionsFilename
OrString
[
size
]
=
'\0'
;
}
else
{
...
...
@@ -1584,6 +1562,34 @@ static void nxagentParseOptionString(char *string)
}
}
void
nxagentProcessOptions
(
char
*
string
)
{
if
(
!
string
)
return
;
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Going to process option string/filename [%s].
\n
"
,
__func__
,
validateString
(
string
));
#endif
/* if the "filename" starts with an nx marker treat it
as an option _string_ instead of a filename */
if
(
strncasecmp
(
string
,
"nx/nx,"
,
6
)
==
0
||
strncasecmp
(
string
,
"nx/nx:"
,
6
)
==
0
)
{
nxagentParseOptionString
(
string
+
6
);
}
else
if
(
strncasecmp
(
string
,
"nx,"
,
3
)
==
0
||
strncasecmp
(
string
,
"nx:"
,
3
)
==
0
)
{
nxagentParseOptionString
(
string
+
3
);
}
else
{
nxagentProcessOptionsFile
(
string
);
}
}
void
nxagentProcessOptionsFile
(
char
*
filename
)
{
FILE
*
file
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Args.h
View file @
76ce623a
...
...
@@ -81,6 +81,7 @@ extern Bool nxagentIpaq;
extern
int
nxagentLockDeferLevel
;
Bool
nxagentPostProcessArgs
(
char
*
name
,
Display
*
dpy
,
Screen
*
scr
);
void
nxagentProcessOptions
(
char
*
string
);
void
nxagentProcessOptionsFile
(
char
*
filename
);
void
nxagentSetPackMethod
(
void
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
View file @
76ce623a
...
...
@@ -103,7 +103,7 @@ extern Bool nxagentRenderEnable;
extern
char
*
nxagentKeyboard
;
extern
char
*
nxagentOptionsFilename
;
extern
char
*
nxagentOptionsFilename
OrString
;
enum
SESSION_STATE
nxagentSessionState
=
SESSION_STARTING
;
...
...
@@ -456,7 +456,7 @@ Bool nxagentReconnectSession(void)
nxagentResetOptions
();
nxagentProcessOptions
File
(
nxagentOptionsFilename
);
nxagentProcessOptions
(
nxagentOptionsFilenameOrString
);
if
(
nxagentReconnectDisplay
(
reconnectLossyLevel
[
DISPLAY_STEP
])
==
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment