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
9193d11e
Unverified
Commit
9193d11e
authored
Jul 25, 2017
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/cmdline' into 3.6.x
Attributes GH PR #484:
https://github.com/ArcticaProject/nx-libs/pull/484
parents
4ccb7eda
3f7b3001
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
30 deletions
+47
-30
Args.c
nx-X11/programs/Xserver/hw/nxagent/Args.c
+43
-28
Args.h
nx-X11/programs/Xserver/hw/nxagent/Args.h
+1
-1
Reconnect.c
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+3
-1
No files found.
nx-X11/programs/Xserver/hw/nxagent/Args.c
View file @
9193d11e
...
...
@@ -135,7 +135,7 @@ char nxagentShadowDisplayName[1024] = {0};
char
nxagentWindowName
[
256
];
char
nxagentDialogName
[
256
];
char
nxagentSessionId
[
256
]
=
{
0
};
char
*
nxagentOption
Fil
e
;
char
*
nxagentOption
sFilenam
e
;
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
(
nxagentOption
Fil
e
)
if
(
nxagentOption
sFilenam
e
)
{
nxagentOption
File
=
(
char
*
)
realloc
(
nxagentOptionFil
e
,
strlen
(
argv
[
j
+
1
])
+
1
);
nxagentOption
sFilename
=
(
char
*
)
realloc
(
nxagentOptionsFilenam
e
,
strlen
(
argv
[
j
+
1
])
+
1
);
}
else
{
nxagentOption
Fil
e
=
(
char
*
)
malloc
(
strlen
(
argv
[
j
+
1
])
+
1
);
nxagentOption
sFilenam
e
=
(
char
*
)
malloc
(
strlen
(
argv
[
j
+
1
])
+
1
);
}
if
(
nxagentOption
Fil
e
!=
NULL
)
if
(
nxagentOption
sFilenam
e
!=
NULL
)
{
nxagentOption
File
=
strcpy
(
nxagentOptionFil
e
,
argv
[
j
+
1
]);
nxagentOption
sFilename
=
strcpy
(
nxagentOptionsFilenam
e
,
argv
[
j
+
1
]);
}
#ifdef WARNING
else
...
...
@@ -283,9 +283,24 @@ int ddxProcessArgument(int argc, char *argv[], int i)
}
}
if
(
nxagentOption
Fil
e
)
if
(
nxagentOption
sFilenam
e
)
{
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
);
}
}
}
...
...
@@ -365,23 +380,23 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
int
size
;
if
(
nxagentOption
Fil
e
!=
NULL
)
if
(
nxagentOption
sFilenam
e
!=
NULL
)
{
free
(
nxagentOption
Fil
e
);
free
(
nxagentOption
sFilenam
e
);
nxagentOption
Fil
e
=
NULL
;
nxagentOption
sFilenam
e
=
NULL
;
}
if
((
size
=
strlen
(
argv
[
i
]))
<
1024
)
{
if
((
nxagentOption
Fil
e
=
malloc
(
size
+
1
))
==
NULL
)
if
((
nxagentOption
sFilenam
e
=
malloc
(
size
+
1
))
==
NULL
)
{
FatalError
(
"malloc failed"
);
}
strncpy
(
nxagentOption
Fil
e
,
argv
[
i
],
size
);
strncpy
(
nxagentOption
sFilenam
e
,
argv
[
i
],
size
);
nxagentOption
Fil
e
[
size
]
=
'\0'
;
nxagentOption
sFilenam
e
[
size
]
=
'\0'
;
}
else
{
...
...
@@ -1569,7 +1584,7 @@ static void nxagentParseOptionString(char *string)
}
}
void
nxagentProcessOptionsFile
()
void
nxagentProcessOptionsFile
(
char
*
filename
)
{
FILE
*
file
;
char
*
data
;
...
...
@@ -1581,8 +1596,8 @@ void nxagentProcessOptionsFile()
int
maxFileSize
=
1024
;
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentProcessOptionsFile: Going to process option
the
file [%s].
\n
"
,
validateString
(
nxagentOptionFile
)
);
fprintf
(
stderr
,
"nxagentProcessOptionsFile: Going to process option file [%s].
\n
"
,
validateString
(
filename
);
#endif
/*
...
...
@@ -1590,15 +1605,15 @@ void nxagentProcessOptionsFile()
*/
setStatePath
(
""
);
if
(
nxagentOptionFil
e
==
NULL
)
if
(
filenam
e
==
NULL
)
{
return
;
}
if
((
file
=
fopen
(
nxagentOptionFil
e
,
"r"
))
==
NULL
)
if
((
file
=
fopen
(
filenam
e
,
"r"
))
==
NULL
)
{
fprintf
(
stderr
,
"Warning: Couldn't open option file '%s'. Error is '%s'.
\n
"
,
validateString
(
nxagentOptionFil
e
),
strerror
(
errno
));
validateString
(
filenam
e
),
strerror
(
errno
));
goto
nxagentProcessOptionsFileExit
;
}
...
...
@@ -1606,7 +1621,7 @@ void nxagentProcessOptionsFile()
if
(
fseek
(
file
,
0
,
SEEK_END
)
!=
0
)
{
fprintf
(
stderr
,
"Warning: Couldn't position inside option file '%s'. Error is '%s'.
\n
"
,
validateString
(
nxagentOptionFil
e
),
strerror
(
errno
));
validateString
(
filenam
e
),
strerror
(
errno
));
goto
nxagentProcessOptionsFileClose
;
}
...
...
@@ -1614,14 +1629,14 @@ void nxagentProcessOptionsFile()
if
((
sizeOfFile
=
ftell
(
file
))
==
-
1
)
{
fprintf
(
stderr
,
"Warning: Couldn't get the size of option file '%s'. Error is '%s'.
\n
"
,
validateString
(
nxagentOptionFil
e
),
strerror
(
errno
));
validateString
(
filenam
e
),
strerror
(
errno
));
goto
nxagentProcessOptionsFileClose
;
}
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentProcessOptionsFile: Processing option file [%s].
\n
"
,
validateString
(
nxagentOptionFil
e
));
validateString
(
filenam
e
));
#endif
rewind
(
file
);
...
...
@@ -1629,7 +1644,7 @@ void nxagentProcessOptionsFile()
if
(
sizeOfFile
>
maxFileSize
)
{
fprintf
(
stderr
,
"Warning: Maximum file size exceeded for options '%s'.
\n
"
,
validateString
(
nxagentOptionFil
e
));
validateString
(
filenam
e
));
goto
nxagentProcessOptionsFileClose
;
}
...
...
@@ -1637,7 +1652,7 @@ void nxagentProcessOptionsFile()
if
((
data
=
malloc
(
sizeOfFile
+
1
))
==
NULL
)
{
fprintf
(
stderr
,
"Warning: Memory allocation failed processing file '%s'.
\n
"
,
validateString
(
nxagentOptionFil
e
));
validateString
(
filenam
e
));
goto
nxagentProcessOptionsFileClose
;
}
...
...
@@ -1652,7 +1667,7 @@ void nxagentProcessOptionsFile()
if
(
ferror
(
file
)
!=
0
)
{
fprintf
(
stderr
,
"Warning: Error reading the option file '%s'.
\n
"
,
validateString
(
nxagentOptionFil
e
));
validateString
(
filenam
e
));
goto
nxagentProcessOptionsFileFree
;
}
...
...
@@ -1669,7 +1684,7 @@ void nxagentProcessOptionsFile()
if
(
size
!=
sizeOfFile
)
{
fprintf
(
stderr
,
"Warning: Premature end of option file '%s' while reading.
\n
"
,
validateString
(
nxagentOptionFil
e
));
validateString
(
filenam
e
));
goto
nxagentProcessOptionsFileFree
;
}
...
...
@@ -1696,7 +1711,7 @@ nxagentProcessOptionsFileClose:
if
(
fclose
(
file
)
!=
0
)
{
fprintf
(
stderr
,
"Warning: Couldn't close option file '%s'. Error is '%s'.
\n
"
,
validateString
(
nxagentOptionFil
e
),
strerror
(
errno
));
validateString
(
filenam
e
),
strerror
(
errno
));
}
nxagentProcessOptionsFileExit:
...
...
nx-X11/programs/Xserver/hw/nxagent/Args.h
View file @
9193d11e
...
...
@@ -81,7 +81,7 @@ extern Bool nxagentIpaq;
extern
int
nxagentLockDeferLevel
;
Bool
nxagentPostProcessArgs
(
char
*
name
,
Display
*
dpy
,
Screen
*
scr
);
void
nxagentProcessOptionsFile
(
void
);
void
nxagentProcessOptionsFile
(
char
*
filename
);
void
nxagentSetPackMethod
(
void
);
void
nxagentSetDeferLevel
(
void
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
View file @
9193d11e
...
...
@@ -103,6 +103,8 @@ extern Bool nxagentRenderEnable;
extern
char
*
nxagentKeyboard
;
extern
char
*
nxagentOptionsFilename
;
enum
SESSION_STATE
nxagentSessionState
=
SESSION_STARTING
;
struct
nxagentExceptionStruct
nxagentException
=
{
0
,
0
};
...
...
@@ -454,7 +456,7 @@ Bool nxagentReconnectSession(void)
nxagentResetOptions
();
nxagentProcessOptionsFile
();
nxagentProcessOptionsFile
(
nxagentOptionsFilename
);
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