All BSD style licenses put this text on a separate line, immediately
following the Copyright line. The C-News license is confusing enough
to most people, so let's align at least a bit with the norm.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Use Emacs K&R style
- Add missing braces to for() loops
- Fix coding style issues in cli.c example
- Add empty lines to separate sections
- Simplify and de-indent code, check error case first + continue
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This is a fix to a bug reported by Claus Fischer. When doing a reversed
i-search on the history, clear_line() sets rl_point to a negative value,
which is later used by ceol(). The intention is to clear the whole line
for the new Search: prompt, but indexing an array with a negative value
is strongly discouraged.
To prevent this negative indexing from happening we check in ceol() for
rl_point < 0, but we quickly notice another side effect: one lingering
character at the end of line when returning from i-search. The problem
manifests itself more cleary when having a looooo000ooonong prompt.
The fix is to rub out the extra space, insert the i-search string, and
*then* call ceol() again.
Thanks to Claus for pointing this out!
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Free all allocated internal memory and reset variables so
rl_initialize() or readline() may be called again later.
Signed-off-by: Claus Fischer <claus.fischer@clausfischer.com>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Improper handling of AC_ARG_ENABLE() causes the configure script to
always enable CONFIG_USE_TERMCAP.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Move 'foreign' declaration from Makefile.am's to configure script
- Move CFLAGS from configure script to src/Makefile.am
- Remove faltering license blurb at top of configure script, no need
for this since we a) do not care, b) falls under project license
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This is a followup patch for issue #8. When the user elects
to enable Termcap checks for window resizing we need to check
what library on the system provides this functionality. Do
not assume -ltermcap, but instead check for tgetent() in all
possible libraries.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
netbsd's libedit only relies on functions offered by the traditional
libtermcap (such as tgetent()), which are *usually* (i.e. on the
majority of modern UNIX systems) supplied by ncurses, but there
exist standalone versions as well which can be used instead.
Forcing update should flush, otherwise weird stuff happen when writing
to console asynchronously (cursor is moved, text is not displayed).
Signed-off-by: Jakub Pawlowski <jakubpawlo@gmail.com>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
After removal of autoconf & automake generated friends we must run
./autogen.sh before configre.
Also, use docker to speed up builds (we don't need root).
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>