summaryrefslogtreecommitdiff
path: root/time/wyrd/patches/patch-ab
blob: 226f8493926281ba46be55fa284659c23edac8c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$NetBSD: patch-ab,v 1.1 2008/07/13 20:57:50 tonnerre Exp $

--- interface_main.ml.orig	2006-07-17 00:29:41.000000000 +0200
+++ interface_main.ml
@@ -884,9 +884,9 @@ let handle_view_keybindings (iface : int
    in
    Hashtbl.iter find_binding Rcfile.table_commandstr_command;
    let sorted_list = List.fast_sort Pervasives.compare !bindings in
-   let out_channel = open_out Rcfile.tmpfile in
+   let out_channel = Rcfile.tmpfd in
    List.iter (output_string out_channel) sorted_list;
-   close_out out_channel;
+   flush out_channel;
    def_prog_mode ();
    endwin ();
    let _ = Unix.system ("less " ^ Rcfile.tmpfile) in 
@@ -1640,8 +1640,9 @@ let handle_keypress_normal key (iface : 
          let i = draw_msg iface in
          handle_refresh i reminders
       |Rcfile.Quit ->
-         let new_iface = {iface with run_wyrd = false} in
-         (new_iface, reminders)
+           let out_channel = Rcfile.tmpfd in
+           close_out out_channel;Sys.remove Rcfile.tmpfile;let new_iface = {iface with run_wyrd = false} in
+           (new_iface, reminders)
    with Not_found ->
       let _ = beep () in
       draw_error iface "key is not bound." false;