Revision ab5cad1b core/src/aos_shell.c

View differences:

core/src/aos_shell.c
35 35
/******************************************************************************/
36 36

  
37 37
/**
38
 * @brief   Size of the escape sequence buffer.
39
 */
40
#if !defined(AOS_SHELL_ESCSEQUENCE_LENGTH) || defined(__DOXYGEN__)
41
#define AOS_SHELL_ESCSEQUENCE_LENGTH            8
42
#endif
43

  
44
/**
38 45
 * @brief   The character the input buffer is initialized with.
39 46
 */
40 47
#define INBUF_INIT_CHAR                         '\x07'
......
1456 1463
          n = cmatch;
1457 1464
          _strccmp(line, fill, shell->config & AOS_SHELL_CONFIG_MATCH_CASE, &n, &matchlevel);
1458 1465
          // print the auto fill if any
1459
          if (cmatch > rdata->input.cursorpos || (cmatch == rdata->input.cursorpos && matchlevel == CHAR_MATCH_NCASE)) {
1466
          if ((cmatch > rdata->input.cursorpos) ||
1467
              (cmatch == rdata->input.cursorpos && matchlevel == CHAR_MATCH_NCASE && strlen(fill) == rdata->input.cursorpos)) {
1460 1468
            // limit auto fill so it will not overflow the line width
1461 1469
            if (rdata->input.length + (cmatch - rdata->input.cursorpos) > shell->input.linewidth) {
1462 1470
              cmatch = shell->input.linewidth - rdata->input.length + rdata->input.cursorpos;
......
1496 1504
          // compare line content with command, except if cursorpos is 0
1497 1505
          size_t i = rdata->input.cursorpos;
1498 1506
          if (rdata->input.cursorpos > 0) {
1499
            _strccmp(line, cmd->name, true, &i, NULL);
1507
            _strccmp(line, cmd->name, shell->config & AOS_SHELL_CONFIG_MATCH_CASE, &i, NULL);
1500 1508
          }
1501 1509
          const int cmp = (i < rdata->input.cursorpos) ?
1502 1510
                ((int)i - (int)rdata->input.cursorpos) :

Also available in: Unified diff