Add files from parent branch HEAD:
[pkgsrc.git] / security / putty / patches / patch-an
1 $NetBSD: $
2
3 Make the home/end keys work on BSD servers as well as Linux ones
4
5 Index: unix/gtkwin.c
6 ===================================================================
7 --- unix/gtkwin.c       (revision 8466)
8 +++ unix/gtkwin.c       (working copy)
9 @@ -979,9 +979,17 @@
10                 use_ucsoutput = FALSE;
11                 goto done;
12             }
13 -           if (inst->cfg.rxvt_homeend && (code == 1 || code == 4)) {
14 -               end = 1 + sprintf(output+1, code == 1 ? "\x1B[H" : "\x1BOw");
15 -               use_ucsoutput = FALSE;
16 +           /* Home/End */
17 +           if (code == 1 || code == 4) {
18 +               /* Send the correct XTerm or rxvt codes for home/end
19 +                * We used to send ^[1~ and [4~ for Xterm,
20 +                * but those are Linux console */
21 +               const char *he;
22 +               if (inst->cfg.rxvt_homeend)
23 +                   he = code == 1 ? "\x1B[7~" : "\x1B[8~";
24 +               else
25 +                   he = code == 1 ? "\x1BOH" : "\x1BOF";
26 +               end = 1 + sprintf(output+1, he);
27                 goto done;
28             }
29             if (code) {