X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=config.c;h=9f32bc303dd74f5d7c433b33e09234f3a0b46ced;hb=1472aa2a265dfbfe7225729862ea21b5fb2da22f;hp=02da07da6919da3bce81fb9c3ec0696906a4cd0d;hpb=3692a585f72a2899b979fcd24f4c6d95363df41c;p=PuTTY.git diff --git a/config.c b/config.c index 02da07da..9f32bc30 100644 --- a/config.c +++ b/config.c @@ -1083,9 +1083,23 @@ static void portfwd_handler(union control *ctrl, void *dlg, val != NULL; val = conf_get_str_strs(conf, CONF_portfwd, key, &key)) { char *p; - if (!strcmp(val, "D")) - p = dupprintf("D%s\t", key+1); - else + if (!strcmp(val, "D")) { + char *L; + /* + * A dynamic forwarding is stored as L12345=D or + * 6L12345=D (since it's mutually exclusive with + * L12345=anything else), but displayed as D12345 + * to match the fiction that 'Local', 'Remote' and + * 'Dynamic' are three distinct modes and also to + * align with OpenSSH's command line option syntax + * that people will already be used to. So, for + * display purposes, find the L in the key string + * and turn it into a D. + */ + p = dupprintf("%s\t", key); + L = strchr(p, 'L'); + if (L) *L = 'D'; + } else p = dupprintf("%s\t%s", key, val); dlg_listbox_add(ctrl, dlg, p); sfree(p);