1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-10 23:58:06 -05:00

Pageant now allows filenames with spaces on cmdline. Thanks to Brian Coogan

[originally from svn r623]
This commit is contained in:
Simon Tatham 2000-09-25 10:55:00 +00:00
parent fa5a243407
commit 603619cbfe

View File

@ -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.
* 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 && isspace(*p)) p++;
if (*p && !isspace(*p)) {
char *q = p;
while (*p && !isspace(*p)) p++;
if (*p) *p++ = '\0';
char *q = p, *pp = p;
while (*p && (inquotes || !isspace(*p)))
{
if (*p == '"') {
inquotes = !inquotes;
p++;
continue;
}
*pp++ = *p++;
}
if (*pp) {
if (*p) p++;
*pp++ = '\0';
}
add_keyfile(q);
}
}