]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix relative positioning between two new elements in gprefs().
authorSimon Tatham <anakin@pobox.com>
Sun, 27 Mar 2016 19:06:33 +0000 (20:06 +0100)
committerSimon Tatham <anakin@pobox.com>
Sun, 27 Mar 2016 19:06:33 +0000 (20:06 +0100)
It was only prepared to position a new element relative to an existing
one if the latter was specified in the saved configuration, not if the
latter was another element new to this run of gprefs(). This wasn't
deliberate at all: it was just due to me failing to update the 'seen'
bitmap in the loop adding new elements.

settings.c

index 9c772980c274c9e109cf566beabd2e65d92ebbed..b15839fa153f45fde8391e41b2ca90a2f51d5d74 100644 (file)
@@ -386,6 +386,7 @@ static void gprefs(void *sesskey, const char *name, const char *def,
                     conf_set_int_int(conf, primary, j+1,
                                      conf_get_int_int(conf, primary, j));
                 conf_set_int_int(conf, primary, pos, mapping[i].v);
+                seen |= (1 << mapping[i].v);
                 n++;
             }
         }