cmdbuf.c (7e1b7636c894be9d1130c284089ce1ea0786ecec) | cmdbuf.c (b2ea244070ff84eab79e04befb7aa30c982fc84d) |
---|---|
1/* 2 * Copyright (C) 1984-2017 Mark Nudelman 3 * 4 * You may distribute under the terms of either the GNU General Public 5 * License or the Less License, as specified in the README file. 6 * 7 * For more information, see the README file. 8 */ --- 26 unchanged lines hidden (view full) --- 35static int cmd_complete(); 36/* 37 * These variables are statics used by cmd_complete. 38 */ 39static int in_completion = 0; 40static char *tk_text; 41static char *tk_original; 42static char *tk_ipoint; | 1/* 2 * Copyright (C) 1984-2017 Mark Nudelman 3 * 4 * You may distribute under the terms of either the GNU General Public 5 * License or the Less License, as specified in the README file. 6 * 7 * For more information, see the README file. 8 */ --- 26 unchanged lines hidden (view full) --- 35static int cmd_complete(); 36/* 37 * These variables are statics used by cmd_complete. 38 */ 39static int in_completion = 0; 40static char *tk_text; 41static char *tk_original; 42static char *tk_ipoint; |
43static char *tk_trial; | 43static char *tk_trial = NULL; |
44static struct textlist tk_tlist; 45#endif 46 47static int cmd_left(); 48static int cmd_right(); 49 50#if SPACES_IN_FILENAMES 51public char openquote = '"'; --- 370 unchanged lines hidden (view full) --- 422 423/* 424 * Move cursor left one character. 425 */ 426 static int 427cmd_left() 428{ 429 char *ncp; | 44static struct textlist tk_tlist; 45#endif 46 47static int cmd_left(); 48static int cmd_right(); 49 50#if SPACES_IN_FILENAMES 51public char openquote = '"'; --- 370 unchanged lines hidden (view full) --- 422 423/* 424 * Move cursor left one character. 425 */ 426 static int 427cmd_left() 428{ 429 char *ncp; |
430 int width, bswidth; 431 | 430 int width = 0; 431 int bswidth = 0; 432 |
432 if (cp <= cmdbuf) 433 { 434 /* Already at the beginning of the line */ 435 return (CC_OK); 436 } 437 ncp = cp; 438 while (ncp > cmdbuf) 439 { --- 778 unchanged lines hidden (view full) --- 1218 /* Perform strict validation in all possible cases. */ 1219 if (cmd_mbc_buf_len == 0) 1220 { 1221 retry: 1222 cmd_mbc_buf_index = 1; 1223 *cmd_mbc_buf = c; 1224 if (IS_ASCII_OCTET(c)) 1225 cmd_mbc_buf_len = 1; | 433 if (cp <= cmdbuf) 434 { 435 /* Already at the beginning of the line */ 436 return (CC_OK); 437 } 438 ncp = cp; 439 while (ncp > cmdbuf) 440 { --- 778 unchanged lines hidden (view full) --- 1219 /* Perform strict validation in all possible cases. */ 1220 if (cmd_mbc_buf_len == 0) 1221 { 1222 retry: 1223 cmd_mbc_buf_index = 1; 1224 *cmd_mbc_buf = c; 1225 if (IS_ASCII_OCTET(c)) 1226 cmd_mbc_buf_len = 1; |
1227#if MSDOS_COMPILER || OS2 1228 else if (c == (unsigned char) '\340' && IS_ASCII_OCTET(peekcc())) 1229 { 1230 /* Assume a special key. */ 1231 cmd_mbc_buf_len = 1; 1232 } 1233#endif |
|
1226 else if (IS_UTF8_LEAD(c)) 1227 { 1228 cmd_mbc_buf_len = utf_len(c); 1229 return (CC_OK); 1230 } else 1231 { 1232 /* UTF8_INVALID or stray UTF8_TRAIL */ 1233 bell(); --- 441 unchanged lines hidden --- | 1234 else if (IS_UTF8_LEAD(c)) 1235 { 1236 cmd_mbc_buf_len = utf_len(c); 1237 return (CC_OK); 1238 } else 1239 { 1240 /* UTF8_INVALID or stray UTF8_TRAIL */ 1241 bell(); --- 441 unchanged lines hidden --- |