~ubuntu-branches/debian/squeeze/mksh/squeeze

« back to all changes in this revision

Viewing changes to edit.c

  • Committer: Bazaar Package Importer
  • Author(s): Thorsten Glaser
  • Date: 2010-07-29 08:54:25 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20100729085425-s3kq56iv7xpg0kvz
Tags: 39.3.20100725-1
* The “Portability?” release
* Another new CVS snapshot:
  - [tg] More int → bool conversion
  - [tg] Fix window size not being checked during runtime
    of external programmes by not relying on SIGWINCH so
    much but instead checking before every interactive
    editing of a command line
* High urgency because 39.3.20100721-1 isn’t yet in testing
* Policy 3.9.1.0, no changes needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
#include "sh.h"
27
27
 
28
 
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.195 2010/07/17 22:09:32 tg Exp $");
 
28
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.196 2010/07/25 11:35:40 tg Exp $");
29
29
 
30
30
/*
31
31
 * in later versions we might use libtermcap for this, but since external
59
59
#define XCF_COMMAND_FILE (XCF_COMMAND|XCF_FILE)
60
60
 
61
61
static char editmode;
 
62
static int xx_cols;                     /* for Emacs mode */
62
63
static int modified;                    /* buffer has been "modified" */
63
64
static char holdbuf[LINE];              /* place to hold last edit buffer */
64
65
 
153
154
                if (trap) {
154
155
                        x_mode(false);
155
156
                        runtraps(0);
 
157
#ifdef SIGWINCH
 
158
                        if (got_winch) {
 
159
                                change_winsz();
 
160
                                if (x_cols != xx_cols && editmode == 1) {
 
161
                                        /* redraw line in Emacs mode */
 
162
                                        xx_cols = x_cols;
 
163
                                        x_e_rebuildline(MKSH_CLRTOEOL_STRING);
 
164
                                }
 
165
                        }
 
166
#endif
156
167
                        x_mode(true);
157
168
                }
158
169
        return ((n == 1) ? (int)(unsigned char)c : -1);
823
834
 */
824
835
static int x_adj_done;
825
836
 
826
 
static int xx_cols;
827
837
static int x_col;
828
838
static int x_displen;
829
839
static int x_arg;               /* general purpose arg */
3110
3120
        static bool x_cur_mode;
3111
3121
        bool prev;
3112
3122
 
3113
 
        if (onoff && got_winch) {
3114
 
                change_winsz();
3115
 
                if (x_cols != xx_cols && editmode == 1) {
3116
 
                        /* redraw line in Emacs mode */
3117
 
                        xx_cols = x_cols;
3118
 
                        x_e_rebuildline(MKSH_CLRTOEOL_STRING);
3119
 
                }
3120
 
        }
3121
 
 
3122
3123
        if (x_cur_mode == onoff)
3123
3124
                return (x_cur_mode);
3124
3125
        prev = x_cur_mode;