Commit Graph

337 Commits

Author SHA1 Message Date
Joachim Nilsson
1305d05b75 examples: Refactor CLI unlock gimmick to fix possible Coverity issue
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2020-01-05 08:21:36 +01:00
Joachim Nilsson
d9f725f20a Travis-CI: Disable clang temporarily for Coverity Scan run
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2020-01-05 07:58:33 +01:00
Joachim Nilsson
7278fd8581 Travis-CI: Clean build between different phases
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2020-01-05 07:58:13 +01:00
Joachim Nilsson
f619d9d788 Follow-up to d310910, use EOF instead of -1 in calls to reposition()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2020-01-05 07:52:31 +01:00
Joachim Nilsson
6c74203cbd Update ChangeLog with latest fixes
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2020-01-05 07:52:31 +01:00
Joachim Nilsson
b44335f413 Defensive programming, check within boundaries before deref
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2020-01-05 07:52:31 +01:00
Joachim Nilsson
e36aae07f8 Refactor move_cursor_forward() into tty_forwardn()
- Use same namespace like other tty movement functions
- Replace globally exposed itoa() and dangerous strcpy() with snprintf()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2020-01-05 07:52:31 +01:00
Joachim Nilsson
cf8f962e4f Handle realloc() failures better
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2020-01-05 07:52:31 +01:00
Joachim Nilsson
deb2884310 Fix error return value from read_history() and write_history()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2020-01-05 07:52:31 +01:00
Joachim Nilsson
81840c0f84 Update ChangeLog to reflect latest changes
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-28 07:03:44 +01:00
Joachim Nilsson
0b295197f6 Merge branch 'echoprotocol-simple_multiline' 2019-11-28 07:01:48 +01:00
Joachim Nilsson
1802e086e0 Bump version for v1.17.0 release cycle
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-28 07:01:13 +01:00
Joachim Nilsson
12d5584721 Fix for() loop; "statement with no effect" warning from GCC
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-28 06:59:53 +01:00
Joachim Nilsson
35506cd22e Minor, coding style fixups
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-28 06:58:37 +01:00
Joachim Nilsson
f35af9f20d Merge branch 'simple_multiline' of https://github.com/echoprotocol/editline into echoprotocol-simple_multiline 2019-11-28 06:41:43 +01:00
dvolynets
498b041a35 fixed indentations 2019-11-20 15:14:21 +03:00
dvolynets
d3109109c4 added simple multiline support 2019-11-20 15:14:02 +03:00
Joachim Nilsson
7355f56d25 Update ChangeLog(s) and bump version for v1.16.1 release
New ABI version 1.0.1

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-06-07 12:04:01 +02:00
Joachim Nilsson
5496152d51 Rephrase section introducing Jush, the stupid UNIX shell
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-06-01 17:24:59 +02:00
Joachim Nilsson
13f8d5f69c
Merge pull request #32 from abitmore/search-end-cleanup
Cleanup el_intr_pending in h_search_end()
2019-05-08 17:11:02 +02:00
Joachim Nilsson
c2b65646ea Revert "Fi #31: Aborting i-search with Ctrl-C should not generate signal"
This reverts commit e2c3b41d9a.
2019-05-08 17:10:21 +02:00
Joachim Nilsson
e2c3b41d9a Fi #31: Aborting i-search with Ctrl-C should not generate signal
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-05-08 17:04:15 +02:00
Joachim Nilsson
4a17180d37 Add SIGINT notification to cli example, for debugging
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-05-08 17:03:49 +02:00
Joachim Nilsson
3e046cafd2 Clear line on failed Ctrl-R operation
The Ctrl-R search prompt and failed search text may be longer than
the regular CLI prompt.  This patch clears the line to remove any
lingering artefacts.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-05-08 16:57:40 +02:00
Joachim Nilsson
0e493addab Fix #30: Ctrl-R with empty search string clears screen
The screen should only be cleared on Ctrl-L *and* empty regular line,
not when searching with an empty string.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-05-08 16:55:33 +02:00
abitmore
842bd67dd4 Cleanup el_intr_pending in h_search_end()
Fixes an issue when user pressed Ctrl+C when searching.
2019-05-08 07:51:13 -04:00
Joachim Nilsson
0eb8f228f7
Merge pull request #29 from abitmore/rl_set_getc_func
Add rl_set_getc_func()
2019-05-08 10:48:39 +02:00
abitmore
8f6d724e30 Add rl_set_getc_func()
So it's possible to install another implementation of rl_getc() function.
2019-05-07 17:58:06 -04:00
Joachim Nilsson
ee176c80d7 Only display return from readline() when there's something to show.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-05-06 01:20:46 +02:00
Joachim Nilsson
979f05a5eb Follow-up to a4b67d2: Ctrl-L redisplay line when not on empty line
Like Ctrl-D, when on an empty line we clear the screen, when editing a
garbled line we refresh the line.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-05-06 00:54:57 +02:00
Joachim Nilsson
c95d25731d Always use enums for el_status_t return values
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-05-06 00:54:17 +02:00
Joachim Nilsson
61d40f406f examples: Catch SIGINT instead of mapping Ctrl-C, use default Ctrl-D
We want Ctrl-C to work as in Bash, so let's just catch SIGINT (and do
nothing).  Also, the default Ctrl-D handler does what we want, i.e.
exit the CLI when we're on an empty line.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-05-06 00:52:13 +02:00
Joachim Nilsson
385cd77e9b Merge branch 'abitmore-patch-1' 2019-05-03 17:13:39 +02:00
Abit
448a3dac08
Avoid continuously duplicate commands in history
When adding a command to history, if CONFIG_UNIQUE_HISTORY is defined, always compare current command with the last entry in history.
2019-05-03 16:54:25 +02:00
Joachim Nilsson
7506826ac7 debian: libeditline1 does not have any shlib deps.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-04-27 15:44:30 +02:00
Joachim Nilsson
ec7f752095 debian: Add missing pkg-cconfig .pc file to -dev package
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-04-27 15:43:56 +02:00
Joachim Nilsson
959a9e7199 Prepare for debian v1.16.1 release
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-04-27 15:01:28 +02:00
Joachim Nilsson
397ac9dd56 Update ChangeLog with latest fixes
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-04-27 12:47:20 +02:00
Joachim Nilsson
e58868bec1 Mention jush as another example of Editline
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-04-27 12:46:59 +02:00
Joachim Nilsson
650d0f15c6 Correction, this version of the library stems from Minix 2
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-04-27 12:46:31 +02:00
Joachim Nilsson
2aee394b44 Major update of man page, exand on APIs and history of library
- Convert from obtruse troff syntax to simpler mdoc format
- Add history APIs, most relevant extra APIs available
- Expand on the history of the library
- Rewrite some sections for accessiblilty

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-04-27 12:32:58 +02:00
Joachim Nilsson
dd1af360c3 Merge branch 'dtzWill-fix/narrow-terms' 2019-04-27 09:11:19 +02:00
Will Dietz
8660aef4b7 editline: fix behavior when tty is narrower than column width
Fixes crash when dividing by the number of columns,
which was computed as zero in this situation.

Instead, always have at least one "column" even if it wraps.
2019-04-26 13:30:15 -05:00
Joachim Nilsson
6a4d77ca69 Update ChangeLog with latest fixes
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-04-07 12:46:23 +02:00
Joachim Nilsson
0b554cf8c8 Bump version for v1.16.1 release cycle
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-04-07 12:46:01 +02:00
Joachim Nilsson
8f5a5da754 examples/fileman.c: Further code cleanup and simplification
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-12-31 22:51:39 +01:00
Joachim Nilsson
a237e39181 examples/fileman.c: Refactor and cleanup
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-12-31 22:49:28 +01:00
Joachim Nilsson
3cb74b6d87 examples/fileman.c: Remove unnecessary code
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-12-31 22:41:15 +01:00
Joachim Nilsson
5c8429dcee examples/fileman.c: Deregister
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-12-31 22:39:20 +01:00
Joachim Nilsson
8566eb8384 examples/fileman.c: Reindent to project coding style
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-12-31 22:30:45 +01:00