mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-30 08:20:28 -05:00
Put back the code that ensures "Default Settings" is always in the
session list even if it isn't in the Registry. This got deleted overenthusiastically because I didn't have a comment explaining what it was doing there. Now there's a comment, so I probably won't remove it again. [originally from svn r733]
This commit is contained in:
parent
51b05a4438
commit
17cea8353f
19
settings.c
19
settings.c
@ -338,19 +338,28 @@ void get_sesslist(int allocate) {
|
|||||||
buffer = srealloc(buffer, buflen+1);
|
buffer = srealloc(buffer, buflen+1);
|
||||||
buffer[buflen] = '\0';
|
buffer[buflen] = '\0';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Now set up the list of sessions. Note that "Default
|
||||||
|
* Settings" must always be claimed to exist, even if it
|
||||||
|
* doesn't really.
|
||||||
|
*/
|
||||||
|
|
||||||
p = buffer;
|
p = buffer;
|
||||||
nsessions = 0;
|
nsessions = 1; /* "Default Settings" counts as one */
|
||||||
while (*p) {
|
while (*p) {
|
||||||
nsessions++;
|
if (strcmp(p, "Default Settings"))
|
||||||
|
nsessions++;
|
||||||
while (*p) p++;
|
while (*p) p++;
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sessions = smalloc(nsessions * sizeof(char *));
|
sessions = smalloc((nsessions+1) * sizeof(char *));
|
||||||
|
sessions[0] = "Default Settings";
|
||||||
p = buffer;
|
p = buffer;
|
||||||
i = 0;
|
i = 1;
|
||||||
while (*p) {
|
while (*p) {
|
||||||
sessions[i++] = p;
|
if (strcmp(p, "Default Settings"))
|
||||||
|
sessions[i++] = p;
|
||||||
while (*p) p++;
|
while (*p) p++;
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user