Skip to content

Commit 999d3e0

Browse files
committed
Merge branch 'fix/linux_console_macos' into 'master'
fix(console): Fix linux target build on MacOS See merge request espressif/esp-idf!30005
2 parents 9c99a38 + bd8b1ec commit 999d3e0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/console/linenoise/linenoise.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
#include <stdlib.h>
108108
#include <stdint.h>
109109
#include <stdio.h>
110+
#include "sdkconfig.h"
110111
#if !CONFIG_IDF_TARGET_LINUX
111112
// On Linux, we don't need __fbufsize (see comments below), and
112113
// __fbufsize not available on MacOS (which is also considered "Linux" target)
@@ -580,7 +581,7 @@ static void refreshMultiLine(struct linenoiseState *l) {
580581
int rows = (plen+l->len+l->cols-1)/l->cols; /* rows used by current buf. */
581582
int rpos = (plen+l->oldpos+l->cols)/l->cols; /* cursor relative row. */
582583
int rpos2; /* rpos after refresh. */
583-
int col; /* colum position, zero-based. */
584+
int col; /* column position, zero-based. */
584585
int old_rows = l->maxrows;
585586
int j;
586587
int fd = fileno(stdout);
@@ -635,7 +636,7 @@ static void refreshMultiLine(struct linenoiseState *l) {
635636
rpos2 = (plen+l->pos+l->cols)/l->cols; /* current cursor relative row. */
636637
lndebug("rpos2 %d", rpos2);
637638

638-
/* Go up till we reach the expected positon. */
639+
/* Go up till we reach the expected position. */
639640
if (rows-rpos2 > 0) {
640641
lndebug("go-up %d", rows-rpos2);
641642
snprintf(seq,64,"\x1b[%dA", rows-rpos2);
@@ -796,7 +797,7 @@ void linenoiseEditBackspace(struct linenoiseState *l) {
796797
}
797798
}
798799

799-
/* Delete the previosu word, maintaining the cursor at the start of the
800+
/* Delete the previous word, maintaining the cursor at the start of the
800801
* current word. */
801802
void linenoiseEditDeletePrevWord(struct linenoiseState *l) {
802803
size_t old_pos = l->pos;

0 commit comments

Comments
 (0)