mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-19 03:58:05 -05:00
Pageant now allows filenames with spaces on cmdline. Thanks to Brian Coogan
[originally from svn r623]
This commit is contained in:
parent
fa5a243407
commit
603619cbfe
22
pageant.c
22
pageant.c
@ -608,16 +608,28 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Process the command line and add RSA keys as listed on it.
|
* Process the command line and add RSA keys as listed on it.
|
||||||
* FIXME: we don't support spaces in filenames here. We should.
|
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
char *p = cmdline;
|
char *p;
|
||||||
|
int inquotes = 0;
|
||||||
|
p = cmdline;
|
||||||
while (*p) {
|
while (*p) {
|
||||||
while (*p && isspace(*p)) p++;
|
while (*p && isspace(*p)) p++;
|
||||||
if (*p && !isspace(*p)) {
|
if (*p && !isspace(*p)) {
|
||||||
char *q = p;
|
char *q = p, *pp = p;
|
||||||
while (*p && !isspace(*p)) p++;
|
while (*p && (inquotes || !isspace(*p)))
|
||||||
if (*p) *p++ = '\0';
|
{
|
||||||
|
if (*p == '"') {
|
||||||
|
inquotes = !inquotes;
|
||||||
|
p++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
*pp++ = *p++;
|
||||||
|
}
|
||||||
|
if (*pp) {
|
||||||
|
if (*p) p++;
|
||||||
|
*pp++ = '\0';
|
||||||
|
}
|
||||||
add_keyfile(q);
|
add_keyfile(q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user