Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix getColumns() for Buildroot #31

Merged
merged 1 commit into from Feb 8, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.markdown
Expand Up @@ -32,6 +32,7 @@ The library is currently less than 400 lines of code. In order to use it in your
* Linux text only console ($TERM = linux)
* Linux KDE terminal application ($TERM = xterm)
* Linux xterm ($TERM = xterm)
* Linux Buildroot ($TERM = vt100)
* Mac OS X iTerm ($TERM = xterm)
* Mac OS X default Terminal.app ($TERM = xterm)
* OpenBSD 4.5 through an OSX Terminal.app ($TERM = screen)
Expand Down
2 changes: 1 addition & 1 deletion linenoise.c
Expand Up @@ -182,7 +182,7 @@ static void linenoiseAtExit(void) {
static int getColumns(void) {
struct winsize ws;

if (ioctl(1, TIOCGWINSZ, &ws) == -1) return 80;
if (ioctl(1, TIOCGWINSZ, &ws) == -1 || ws.ws_col == 0) return 80;
return ws.ws_col;
}

Expand Down