If ioctl() fails get num of columns querying the terminal.

This change makes linenoise both more robust if the ioctl() fails, and
far more portable to non POSIX systems, since the ioclt() to query the
terminal was probably one of the non trivial parts to replace.

The code is inspired to Andreas Kupries commit 24186e99 on the win32
Linenoise port from Steve Bennett, but is a complete reimplementation.
1 file changed
tree: 9194b2aa2d8484d031136b7b82307bc80a4f65cd
  1. .gitignore
  2. example.c
  3. linenoise.c
  4. linenoise.h
  5. Makefile
  6. README.markdown