12026-03-04 11:31 christos 2 3 * makelist, map.c, map.h: No need to keep an allocated field. We 4 know that the first EL_NUM_FCNS are not allocated. 5 62026-03-04 00:04 christos 7 8 * eln.c, makelist, map.c, map.h: PR/60054: Kristofer Peterson: 9 adding user defined functions with narrow name/desription leaks 10 memory 11 122026-03-03 16:06 christos 13 14 * history.c: PR/60052: Kristofer Peterson: history_load() off by 15 one memory access bug 16 172026-03-03 16:05 christos 18 19 * chared.c, common.c, hist.c, hist.h: PR/60050: Kristofer Peterson: 20 libedit doesn't handle long lines correctly Fix history resizing, 21 and copying. 22 232026-02-01 02:52 uwe 24 25 * editline.7: editline(7): Document vi-histedit command 26 27 PR lib/59953 by Artem Bunichev 28 292026-01-18 18:18 christos 30 31 * refresh.c: When trying to print a help message while editing a 32 multiline entry, print move down enough so that the error message 33 does not get printed on top of the newline from Yuishiro NAITO. 34 Example program: 35 36 #include <stdio.h> #include <histedit.h> 37 38 char * prompt(EditLine *el) { return "(config) "; } 39 40 static unsigned char help(EditLine *el, int ch) { 41 42 printf("\n"); 43 printf("aaa:\n"); 44 printf("bbb:\n"); 45 printf("ccc:\n"); 46 printf("ddd:\n"); 47 48 return CC_REDISPLAY; 49 } 50 51 int initialize(EditLine **ret) { EditLine *el; 52 53 if ((el = el_init("sample", stdin, stdout, stderr)) == 54 NULL) 55 goto error; 56 57 el_set(el, EL_PROMPT, prompt); 58 el_set(el, EL_EDITOR, "emacs"); 59 el_set(el, EL_ADDFN, "help", "", help); 60 el_set(el, EL_BIND, "?", "help", NULL); 61 62 *ret = el; 63 return 0; 64 65 error: el_end(el); *ret = NULL; return -1; } 66 67 int main(int argc, char *argv[]) { EditLine *el; const 68 wchar_t *cmd; int len; 69 70 if (initialize(&el) < 0) { 71 printf("initialize failed\n"); 72 return 1; 73 } 74 75 while ((cmd = el_wgets(el, &len)) != NULL) { 76 printf("ok\n"); 77 } 78 79 el_end(el); 80 81 return 0; 82 } 83 842026-01-09 23:12 kre 85 86 * edit.expsym: Add rl_kill_full_line which was recently added 87 88 Probably that addition also warranted a libedit minor bump. 89 90 Hopefully unbreak the builds. 91 922026-01-09 18:49 christos 93 94 * readline.c, readline/readline.h: PR/59883: nia: implement 95 rl_kill_full_line 96 972025-12-16 03:40 kre 98 99 * editline.3, el.c, el.h, histedit.h, terminal.c, vi.c: [Prereq for 100 PR bin/58609] Add EL_GETENV to libedit 101 102 When interacting with the shell, and perhaps other applications, 103 editline needs to obtain the values of some environment 104 variables. 105 106 Normally getenv(3) does that - but that doesn't work when being 107 used in sh(1) as getenv() simply accesses the environment as it 108 was when sh(1) was invoked - after that, in sh anyway, that 109 environment is simply abandoned (well, kind of) - but certainly 110 no changes made by the shell will be reflected there. 111 112 To allow editline to obtain current values of environment 113 variables, add a new el_set()/el_get() "op" parameter value, 114 which can be used to instruct editline which function to use for 115 the purpose. That is EL_GETENV. 116 117 This is part of a (long pending, awaiting testing) fix for PR 118 bin/58609 - but I'm getting tired of having it sitting 119 uncommitted in my source tree - and I think this part is self 120 contained, and simple enough, to simply commit. 121 1222025-12-14 19:07 christos 123 124 * chared.c, chared.h, common.c, editline.3, el.c, eln.c, emacs.c, 125 histedit.h, map.c, map.h, search.c, vi.c: PR/59737: Bernie 126 Siegert: Add a method to set custom wordchars. 127 1282025-08-02 07:54 perseant 129 130 * edit.expsym, el.c, el.h, history.c, keymacro.c, literal.c, map.c, 131 read.c, readline.c, refresh.c, sig.c: Sync with HEAD 132 1332025-06-14 15:43 christos 134 135 * readline.c, sig.c: Change kill(0, signo) -> raise(signo) so that 136 we only signal the current process not the whole process group. 137 Pointed out by geoff thomas. Related issues: 138 https://www.postgresql.org/message-id/271520.1713052173%40sss.pgh.pa.us 139 https://github.com/astral-sh/python-build-standalone/pull/652\ 140 #issuecomment-2972762033 141 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=159226 142 1432025-01-03 01:40 rillig 144 145 * el.c, el.h, keymacro.c, map.c, read.c: libedit: remove redundant 146 break statements after EL_ABORT 147 1482024-12-18 16:38 christos 149 150 * sig.c: From tkoeppe@github: Specify SA_ONSTACK when setting up a 151 signal handler. This allows the handler to use the alternate 152 signal stack if one is available in the handling thread, but has 153 no effect otherwise. 154 155 This change makes the signal handler respect existing choices 156 better. Specifically, this allows signal handlers to be set when 157 the process includes a Go runtime, since Go enforces that all 158 signal handlers in the process use the SA_ONSTACK flag (e.g. see 159 golang/go#20400). 160 1612024-12-05 23:21 christos 162 163 * literal.c, refresh.c: Don't eat 0 width characters, print them. 164 1652024-11-21 20:49 riastradh 166 167 * edit.expsym: libedit: Add expected symbols list. 168 169 PR lib/58838: shared libraries in base should all have expsym 170 lists 171 1722024-11-21 20:49 perseant 173 174 * edit.expsym: file edit.expsym was added on branch 175 perseant-exfatfs on 2025-08-02 05:54:48 +0000 176 1772024-07-11 07:41 kre 178 179 * history.c: Don't fchmod(fileno(fp), ...) in history_save_fp(). 180 181 There are two reasons for this, first, the permissions of the 182 history file should be able to be set by the user, not forced to 183 0600 every time the history file is overwritten (or appended to). 184 185 And more importantly, the fp used for fileno(fp) might have come 186 from fmemopen() or funopen() (etc) - none of which put a file 187 descriptor in the "fd" field (ie: fileno(fp) == -1). 188 189 To compensate for that, when a history file is opened (in 190 history_save()) set the default permissions then - if the file is 191 actually created. As fopen() cannot do that (it simply uses 192 0666&~umask) create the (normal type) of fp using (approximately) 193 fdopen(open(...), ...) where the open supplies the 0600 default 194 permissions that are desired here (which might still be 195 restricted even more by the umask). Callers using 196 history(...,H_SAVE_FP,...) or history(...,H_NSAVE_FP,...) now 197 need to look after any permission setting required themselves 198 (but as the doc says absolutely nothing about that, one way or 199 the other, what happens in this area has always been unspecified, 200 and still is) 201 202 One "feature" of the fchmod() method is lost here - apart from 203 forcing the 0600 permissions (which isn't really desirable) that 204 fchmod() would also have failed if the current (effective) uid is 205 not the owner of the history file (or root). If that is 206 required, a test for it could be added later - the effect would 207 be as it has always been, the file named must have been writable 208 (or its directory writable if the file did not exist) the open 209 would occur (potentially truncating the file) after which the 210 fchmod() would be attempted, possibly failing, and if so, never 211 writing anything. Any new uid test would work the same way. 212 213 OK christos@ 214 2152024-07-01 03:01 perseant 216 217 * common.c, refresh.c, search.c: Sync with HEAD. 218 2192024-06-30 19:11 christos 220 221 * refresh.c: Handle the case where the cursor is on the first 222 character. set -o vi x ESC ~ (Robert Morris) 223 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279545 224 2252024-06-30 18:29 christos 226 227 * common.c: Avoid moving the cursor before the buffer (Robert 228 Morris) https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279487 229 2302024-06-30 18:26 christos 231 232 * search.c: Prevent reading before the line buffer (try ^R^W in 233 emacs mode at the beginning of the line) (Robert Morris) 234 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279426 235 2362024-06-29 19:28 christos 237 238 * emacs.c: don't use oldc before it is set. 239 2402024-06-29 16:13 christos 241 242 * chared.c: Prevent testing out of bounds memory. From Robert 243 Morris https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279762 244 2452024-06-29 16:09 christos 246 247 * emacs.c: Retrieve the cursor position after calling c_insert, 248 because c_insert could enlarge the line buffer making the old 249 cursor position point to freed memory. From Robert Morris 250 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279772 251 2522024-05-17 04:59 christos 253 254 * el.h, eln.c: When calling el_line make sure that we call the 255 resizing function callback because el_line updates the legacy 256 LineInfo structure and we need to notify that the cached copy of 257 the the buffer has changed. Of course the resizing function can 258 call el_line itself to update the buffer, so prevent recursion. 259 Bug found by Peter Rufer at Arista. 260 2612024-04-06 15:36 christos 262 263 * editline.7: update em-toggle-overwrite binding (Xose Vazquez 264 Perez) 265 2662024-03-26 19:02 christos 267 268 * readline.c: fix insert key (Xose Vazquez Perez) 269 2702024-02-04 19:47 andvar 271 272 * editline.3: s/interrrupt/interrupt/ in comment and editline(3) 273 man page. 274 2752023-08-10 22:38 mrg 276 277 * chartype.c: avoid various use-after-free issues. 278 279 create a ptrdiff_t offset between the start of an allocation 280 region and some interesting pointer, so it can be adjusted with 281 this offset after realloc() returns. 282 283 found by GCC 12. 284 2852023-08-03 16:56 rin 286 287 * Makefile: Revert CC_WNO_USE_AFTER_FREE from Makefile's (thanks 288 uwe@) 289 2902023-08-03 15:36 rin 291 292 * Makefile: Sprinkle CC_WNO_USE_AFTER_FREE for GCC 12 293 294 All of them are blamed for idiom equivalent to: newbuf = 295 realloc(buf, size); p = newbuf + (p - buf); 296 2972023-06-21 23:44 wiz 298 299 * libedit.pc: libedit: fix pkg-config to really provide readline 300 directory as intended 301 3022023-06-21 01:09 wiz 303 304 * Makefile, libedit.pc: install pkg-config file for libedit 305 306 version number matches portable libedit --cflags output matches 307 portable libedit, since users probably want the readline 308 interface 309 3102023-06-03 11:09 lukem 311 312 * Makefile: bsd.own.mk: rename GCC_NO_* to CC_WNO_* 313 314 Rename compiler-warning-disable variables from GCC_NO_warning to 315 CC_WNO_warning where warning is the full warning name as 316 used by the compiler. 317 318 GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH 319 320 Using the convention CC_compilerflag, where compilerflag is based 321 on the full compiler flag name. 322 3232023-05-30 13:53 christos 324 325 * tokenizer.c: Fix some const qual (Piotr Pawel Stefaniak) 326 3272023-04-25 19:51 christos 328 329 * filecomplete.c, filecomplete.h, readline.c, sys.h, 330 readline/readline.h: pass lint. 331 3322023-04-24 22:02 christos 333 334 * readline.c: PR/57376: Jorge Giner: readline file completion does 335 not quote; do the same. 336 3372023-04-21 16:56 christos 338 339 * readline.c, readline/readline.h: Align types with readline-8.2 340 (wiz@) 341 3422023-02-04 15:34 christos 343 344 * config.h, sys.h, terminal.c: Remove unused stuff, and limit the 345 scope of some of the used ones. (from des@freebsd) 346 3472023-02-03 23:01 christos 348 349 * filecomplete.c, histedit.h: Add a entry point for the complete 350 function for FreeBSD compatibility with sh. 351 3522023-02-03 20:47 christos 353 354 * sig.c: Don't clear the handle to el "sel" and set it earlier to 355 prevent handling a signal before the handle is set. (From: des at 356 FreeBSD) 357 3582022-12-06 01:59 uwe 359 360 * editrc.5: editrc(5): Markup fixes 361 3622022-12-02 20:23 christos 363 364 * readline.c: PR/57095: Yilei Yang: Change readline's 365 replace_history_entry to not make a copy of the string to replace 366 since H_REPLACE already makes a copy (fixes memory leak) 367 3682022-10-30 20:11 christos 369 370 * chared.c, chartype.c, el.c, filecomplete.c, map.c, read.c, 371 read.h, readline.c, terminal.c: improvements in malloc/free 372 handling. 373 3742022-09-21 03:33 christos 375 376 * readline.c: PR/57016: Ricky Zhou: declare lastidx 377 3782022-09-21 01:41 christos 379 380 * readline.c: PR/57016: Ricky Zhou: Revert to trimming the last 381 newline instead of the first one so that multi-line commands work 382 again. 383 3842022-04-11 21:37 tnn 385 386 * chartype.h: libedit/chartype.h: portability fix for OSF/1 387 3882022-04-08 22:11 christos 389 390 * readline.c: PR/56778: Detlev Casanova: Missing rl_initialize call 391 in rl_copy_text 392 3932022-03-12 16:29 christos 394 395 * filecomplete.c: Fix filename autocompletion for strings like a\)b 396 397 An escaped character should unconditionally be skipped together 398 with the character that does the escaping. For example, in "a\)b" 399 only the ")b" part was skipped but then the loop stopped at the 400 "\" since it's one of the characters listed in word_break. (Piotr 401 P. Stefaniak) 402 4032022-02-19 18:45 christos 404 405 * readline.c, readline/readline.h: PR/56695: Walter Lozano: Correct 406 declaration of hook functions. 407 4082022-02-08 22:13 rillig 409 410 * chared.c, histedit.h: libedit: fix typos, apply KNF to newly 411 imported code (PR/56693) 412 413 No binary change. 414 4152022-02-08 16:05 christos 416 417 * chared.c, histedit.h, readline.c, readline/readline.h: PR/56693: 418 Walter Lozano: Add support for rl_delete_text and rl_set_key 419 4202022-01-31 15:44 christos 421 422 * readline.c, readline/readline.h: PR/56622: Walter Lozano: Improve 423 readline compatibility by adding rl_readline_state support. 424 4252022-01-29 21:52 christos 426 427 * readline.c: Add more refreshes from Walter Lozano. The readline 428 example in 429 http://www.mcld.co.uk/blog/2009/simple-gnu-readline-callback-style-example.html 430 still does not work, but it is better. 431 4322022-01-14 14:31 christos 433 434 * readline/readline.h: Don't use __printflike, use the explicit 435 attribute so that this works outside NetBSD. 436 4372022-01-14 13:48 tnn 438 439 * readline/readline.h: libedit: rl_message: annotate __printflike 440 4412022-01-11 19:30 christos 442 443 * chared.c, eln.c, histedit.h, readline.c, readline/readline.h: 444 PR/56618: Walter Lozano: Improve libedit compatibility with 445 readline by implementing: 446 447 rl_copy_text, rl_erase_empty_line, rl_message, 448 rl_on_new_line, 449 rl_replace_line, rl_restore_prompt, rl_save_prompt 450 4512021-09-26 15:45 christos 452 453 * filecomplete.h: make flag unsigned to match prototype of the 454 function used 455 4562021-09-26 15:45 christos 457 458 * filecomplete.c: - Completion should not add a quote at the end of 459 the line to match an already quoted quote. (Piotr Stefaniak) - 460 fix lint unconst warnings for strchr 461 4622021-09-10 20:51 rillig 463 464 * readline.c: libedit: fix indentation 465 466 No change to the resulting object files. 467 4682021-09-10 15:33 christos 469 470 * TEST/fuzz1.c: Add an LLVM fuzzing wrapper for the portable 471 libedit (Christian Holler) 472 4732021-09-10 15:29 christos 474 475 * readline.c: rl_startup_hook should be called each time. From 476 Carlos Henrique Lima Melara 477 4782021-09-09 22:25 christos 479 480 * readline.c: fix memory issues found by fuzzing (double frees and 481 buffer overflows) 482 4832021-09-09 22:24 christos 484 485 * refresh.c, terminal.c: Add casts to appease conversions between 486 wchar_t and wint_t 487 4882021-09-03 14:20 christos 489 490 * readline.c: Try to refactor this in order to correct some of the 491 memory issues reported by Christian Holler. 492 4932021-08-30 11:18 christos 494 495 * ChangeLog: Add a changes file 496 4972021-08-29 11:41 christos 498 499 * map.c: ^W is traditionally bound to ed-delete-prev-word and not 500 kill-region ^R is traditionally bound to em-inc-search-next and 501 not redisplay This is what mksh, zsh bash, readline do (Baptiste 502 Daroussin) 503 5042021-08-28 19:17 christos 505 506 * vi.c: Respect $EDITOR when execution one (Baptiste Daroussin) 507 5082021-08-21 14:38 christos 509 510 * readline.c: PR/56370: mirabilos: libedit change from 2017 kills 511 history in gdb 512 5132021-08-21 14:34 christos 514 515 * readline.c, readline/readline.h: Add more api to make gdb-11 516 happy (but not gdbtui as usual) 517 5182021-08-16 00:22 rillig 519 520 * readline.c: libedit: simplify calls to macro ADD_STRING 521 522 The lint comments CONSTCOND and LINTED were not necessary. It is 523 simpler to just specify what to free. GCC optimizes free(NULL) 524 to be a no-op. 525 526 No functional change. 527 5282021-08-16 00:14 rillig 529 530 * readline.c: readline: fix lint warning about effective unconst 531 cast 532 533 Calling strchr to avoid the syntactical unconst cast is not 534 necessary here. A simple pointer assignment is enough. 535 536 No functional change. 537 5382021-08-15 12:12 wiz 539 540 * editline.3: Add verb to sentence. 541 5422021-08-15 12:08 christos 543 544 * editline.3, el.c, el.h, eln.c, histedit.h, read.c: Disable 545 attempts to handle EINTR and non-blocking I/O by default. It is 546 confusing to other programs and unexpected behavior. Reported by 547 Ingo Schwarze. This behavior is now controlled with EL_SAFEREAD. 548 5492021-08-15 12:06 christos 550 551 * readline.c: Add a LINTED comment... Why doesn't NOTREACHED work? 552 5532021-07-31 22:51 andvar 554 555 * tty.h: s/dependend/dependent/ 556 5572021-07-14 09:47 christos 558 559 * tty.c: Via Jess Thrysoee, from Adrian Bunk: Fix libedit build on 560 Linux/Alpha Alpha is the only Linux architecture that has 561 SIGINFO: 562 https://sources.debian.org/src/manpages/5.10-1/man7/signal.7/#L522 563 564 But even on Alpha Ctrl-T is not supported, and therefore no 565 VSTATUS: 566 https://sources.debian.org/src/manpages/5.10-1/man3/termios.3/#L603-L608 567 568 For consistency check both signal existence and character 569 existence 570 5712021-05-05 16:49 christos 572 573 * filecomplete.c: PR/56147: Miroslav Lichvar: Avoid memory leak if 574 strdup fails. 575 5762021-03-28 15:39 christos 577 578 * filecomplete.c: Only unescape when we are quoting and don't add a 579 space if we are quoting (we already did) (Piotr Stefaniak) 580 5812021-03-28 15:38 christos 582 583 * filecomplete.h: document the flag 584 5852021-03-28 15:33 christos 586 587 * filecomplete.c: Pass the unescaped filename the the append 588 function so it has to do less work (for example it can call 589 stat(2) directly (Piotr Stefaniak) 590 5912021-03-27 19:55 christos 592 593 * filecomplete.c, filecomplete.h: Add fn_complete2() that controls 594 the quoting of the returned match. Before it was based on the 595 heuristic that we were not supplied an 596 attempted_completion_function, which worked well because programs 597 that supplied that function were not shells and did not 598 want/understand shell quoting. Recently though Piotr Stefaniak 599 wanted to enhance command completion for the Bourne Shell and 600 this could benefit quoting the returned command. This function 601 adds an extra flags argument that controls that quoting. 602 6032020-07-10 22:34 christos 604 605 * terminal.c: Fix numeric variable handling in settc (lyzliyuzhi at 606 163 dot com) 607 6082020-06-01 01:24 christos 609 610 * terminal.c, tty.c: use strlcpy() instead of strncpy() for gcc 611 happiness 612 6132020-04-13 10:03 martin 614 615 * Makefile, chared.c, chartype.c, chartype.h, el.c, el.h, 616 filecomplete.c, hist.c, history.c, keymacro.c, literal.c, map.c, 617 parse.c, read.c, readline.c, search.c, terminal.c, vi.c, 618 TEST/test_filecompletion.c: Mostly merge changes from HEAD upto 619 20200411 620 6212020-04-08 16:07 martin 622 623 * common.c, map.c, refresh.c, search.c: Merge changes from current 624 as of 20200406 625 6262020-03-30 08:56 ryo 627 628 * search.c: patbuf must be updated if the length of patbuf is 629 greater than or equal to 0. (that is always) fix of r1.7 was 630 incorrect. 631 6322020-03-30 08:54 ryo 633 634 * common.c, map.c, refresh.c, search.c: fix build error with 635 SDEBUG, MAP_DEBUG, DEBUG_REFRESH 636 6372020-01-05 08:12 abhinav 638 639 * filecomplete.c: PR lib/54510 - when user supplied completion 640 function is there, don't unescape the string to be completed. 641 6422020-01-05 01:03 tih 643 644 * filecomplete.c: Summary: Remove over-simplified extraneous test 645 646 The file name matching code in libedit tries to adjust to the 647 presence of explicit " or ' characters in the input line, but 648 tries too hard. Remove a conditional that goes overboard, and 649 causes the completion code to fail if a quoted string is seen 650 before the filename to be expanded, as in 651 652 grep 'foo' bar<TAB> 653 654 Before this change, the above would not expand any possible 655 completions, even if they existed, because it would choose to 656 look for files whose names started with " bar". 657 6582019-12-10 20:42 christos 659 660 * filecomplete.c: When 'attempted_completion_function' non-NULL, 661 with a 'single_match' match, the expected space is not being 662 added. Problem observed with "chronyc" and "sqlite3" tab 663 completion. That functionality got moved to escape_filename() for 664 the !attempted_completion_function case, but the non-NULL 665 'attempted_completion_function' case must also be handled. 666 (Lonnie Abelbeck) 667 6682019-11-12 21:59 christos 669 670 * terminal.c: PR/54654: Soren Tempel: Make sure el_cursor.v < 671 el_terminal.t_size.v when moving around. 672 6732019-10-13 09:28 mrg 674 675 * Makefile: introduce some common variables for use in GCC warning 676 disables: 677 678 GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8) 679 GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8) 680 GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8) 681 GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8) 682 683 use these to turn off warnings for most GCC-8 complaints. many 684 of these are false positives, most of the real bugs are already 685 commited, or are yet to come. 686 687 we plan to introduce versions of (some?) of these that use the 688 "-Wno-error=" form, which still displays the warnings but does 689 not make it an error, and all of the above will be re-considered 690 as either being "fix me" (warning still displayed) or "warning is 691 wrong." 692 6932019-10-09 16:31 christos 694 695 * filecomplete.c, readline.c: add +1 to strlcpy's (Patrick Welche) 696 6972019-10-08 21:21 christos 698 699 * filecomplete.c: remore error(1) comment 700 7012019-10-08 21:17 christos 702 703 * filecomplete.c, history.c, readline.c: Change strncpy to either 704 memcpy (when we know the len), or strlcpy (when we used to NUL 705 terminate explicitly. 706 7072019-09-15 23:09 christos 708 709 * chartype.h, terminal.c: Fix type and remove cast (Yuichiro 710 NAITO/FreeBSD). 711 7122019-09-08 07:50 abhinav 713 714 * filecomplete.c, TEST/test_filecompletion.c: PR lib/54510: Fix 715 file completion inside quotes which broke in rev 1.53 716 717 While there also fix handling character appending in the file 718 completions when inside quotes. For example when inside a quote, 719 if the completion is a directory then append a '/' but don't 720 close the quote. On the other hand when inside a quote if the 721 completion is a file name and it is the only match then we can 722 close the quote. 723 7242019-08-21 13:11 christos 725 726 * readline.c: Increment offset when adding an element to history to 727 keep it aligned with the last element entered (Sandy Li 728 Changqing) 729 7302019-07-28 11:27 christos 731 732 * filecomplete.c: PR/54415: Ricky Zhou: libedit stats completions 733 for non-file completions Use the proper completion function and 734 account for the character appended by the function when computing 735 the number of columns. 736 7372019-07-23 15:10 christos 738 739 * literal.c: remove stray brace 740 7412019-07-23 12:19 christos 742 743 * hist.c: put the NULL check immediately after the allocation 744 7452019-07-23 12:18 christos 746 747 * chared.c, chartype.c, el.c, el.h, filecomplete.c, hist.c, 748 keymacro.c, literal.c, map.c, parse.c, read.c, readline.c, 749 search.c, terminal.c, vi.c: PR/54399: S�ren Tempel: Uninitialized 750 memory access in libedit history. Initialize the buffer using 751 calloc. While here change all malloc(a * sizeof(b)) to calloc(a, 752 sizeof(b)). XXX: should fix realloc similarly. 753 7542019-07-23 11:47 christos 755 756 * chared.c: PR/54400: S�ren Tempel: out-of-bounds read in libedit 757 c_delbefore 758 7592019-06-30 15:30 christos 760 761 * terminal.c: Add a comment explaining why we don't use DO here. 762 Correct the attribution on the previous patch: The patch was from 763 Jordan Lewis and the report from Raphael Poss. 764 7652019-06-29 23:35 christos 766 767 * terminal.c: PR/54329: Raphael Ross: According to 768 https://www.gnu.org/software/termutils/\ 769 manual/termcap-1.3/html_chapter/termcap_4.html#SEC23 the cursor 770 move multiple escapes have undefined results when moving out of 771 the screen. Stop using DO to move down multiple lines and use a 772 loop of newlines instead. 773 7742019-06-11 00:05 christos 775 776 * chartype.c, editline.3, el.c, el.h, eln.c, filecomplete.c, 777 history.c, parse.c, read.c, readline.c, refresh.c, terminal.c, 778 tty.c, tty.h, TEST/test_filecompletion.c, readline/readline.h: 779 Sync with HEAD 780 7812019-06-07 17:21 christos 782 783 * readline.c: PR/54281: Jonathan Perkins: NUL terminate 784 rl_line_buffer on modification to avoid completion leak. 785 7862019-06-07 17:19 christos 787 788 * readline.c, readline/readline.h: PR/54280: 789 rl_completer_quote_characters should be const for readline compat 790 7912019-06-07 17:18 christos 792 793 * readline.c: PR/54279: Jonathan Perkins: Ignore adjacent start/end 794 prompt ignore. 795 7962019-04-26 18:56 christos 797 798 * el.c, eln.c, readline.c: Follow the man page for EL_GETTC and not 799 require a NULL terminated argument list: 800 https://reviews.llvm.org/D61191 801 8022019-04-20 10:44 abhinav 803 804 * filecomplete.c: PR lib/54131 - declare the loop variable outside 805 the for loop 806 8072019-04-12 19:30 christos 808 809 * terminal.c: PR/52359: Benjamin Lorenz: When resizing because of a 810 signal save and restore the cursor position, since it does not 811 change. 812 8132019-04-12 17:12 christos 814 815 * filecomplete.c: PR/54117: Paavo Helde: Fix memory overrun: 816 Account for the closing quote in memory allocation if quoted. 817 8182019-03-31 05:04 abhinav 819 820 * filecomplete.c, TEST/test_filecompletion.c: Perform quoting of 821 filename completions when there are multiple matches as well 822 823 Quoting of special characters in filename completion was 824 implemented for single match case, this enables it for multiple 825 matches as well. For example: 826 827 $ touch 'foo bar' $ touch 'foo baz' $ ls fo<TAB> autocompletes to 828 => $ ls foo\ ba hitting <TAB> again shows: foo bar foo baz 829 830 This required unescaping escape sequences generated during last 831 completion in order to find the word to complete. 832 833 While there, also update the test to include cases for multiple 834 matches. 835 836 Reviewed by christos 837 8382019-03-24 17:42 abhinav 839 840 * filecomplete.c: Only quote the completion matches if we are doing 841 filename completion 842 843 If the user supplies a value for the 844 attempted_completion_function parameter then we cannot be sure if 845 the completion is for filename or something else, in such a case 846 don't attempt to quote the completion matches. 847 848 Reviewed by christos 849 850 This should address PR lib/54067 851 8522019-02-16 00:20 christos 853 854 * readline.c, terminal.c, readline/readline.h: PR/53983: Jonathan 855 Perkins: Fix types for readline compatibility 856 8572019-02-14 21:09 christos 858 859 * readline.c: PR/53981: Jonathan Perkins: history_list should 860 null-terminate 861 8622019-01-18 09:50 pgoyette 863 864 * readline.c, refresh.c: Synch with HEAD 865 8662019-01-10 19:41 christos 867 868 * readline.c: PR/53856: F. Aragon: editline/libedit not prompting 869 colors in readline mode 870 8712019-01-04 04:03 uwe 872 873 * refresh.c: Fix mis-applied change in previous. Don't increment 874 r_oldcv twice. PR lib/53803 875 8762018-12-26 15:01 pgoyette 877 878 * parse.c, readline.c, tty.c, tty.h, readline/readline.h: Sync with 879 HEAD, resolve a few conflicts 880 8812018-12-02 17:58 christos 882 883 * readline.c, tty.c, tty.h, readline/readline.h: Add a couple more 884 readline compat functions. 885 8862018-11-29 04:10 christos 887 888 * parse.c: Fix off by one <tsahara at iij> 889 8902018-11-26 02:52 pgoyette 891 892 * chartype.c, editline.3, el.c, el.h, read.c, refresh.c, 893 terminal.c: Sync with HEAD, resolve a couple of conflicts 894 8952018-11-25 17:21 christos 896 897 * read.c: From Yuichiro Naito (FreeBSD): 898 899 hrs@ says that (cbp >= MB_LEN_MAX) condition is necessary for 900 checking invalid byte sequences. If malicious input was given, 901 libedit would read byte sequences forever. 902 9032018-11-25 17:20 christos 904 905 * chartype.c: From Yuichiro Naito (FreeBSD): hrs@ says that 906 wctomb(3) has an internal shift state, if wctomb(3) is called 907 outside of libedit, the internal state can be changed and causes 908 miscalculate multibyte size. 909 910 So in this part, wcrtomb(3) should be used. wcrtomb(3) requires 911 that shift state is given in the argument. We always initialize 912 the shift state in ct_enc_width() to keep independent from 913 outside of libedit. 914 9152018-11-24 13:17 christos 916 917 * terminal.c: PR/53682: Jordan Lewis: use newlines instead of 918 padded spaces when restoring multi-line histories. 919 9202018-11-18 18:15 christos 921 922 * chartype.c: fix compilation 923 9242018-11-18 18:09 christos 925 926 * chartype.c, editline.3, el.c, el.h, read.c: Remove utf-8 927 requirement (Yuichiro NAITO) 928 9292018-10-23 18:49 christos 930 931 * refresh.c: Apply revisions 1.21, 1.22 from OpenBSD: 932 933 In re_fastputc(), set lastline to the new line, not the previous 934 line so it gets initialized properly. Fixes a crash in bc with 935 MALLOC_OPTIONS=UJ. OK deraadt@, committing on behalf of yasuoka@ 936 937 Initialize "old" screen buffer lines before use; otherwise, they 938 would never get NUL-terminated and cause read buffer overruns. 939 This fixes for example segfaults in sftp(1) that could be 940 triggered by typing in an extremely long string (more than one 941 line - the longer, the likelier to crash), then hitting backspace 942 once. Problem reported and patch OK'ed by sthen@. 943 944 XXX: pullup-8 945 9462018-09-30 03:45 pgoyette 947 948 * history.c: Ssync with HEAD 949 9502018-09-13 11:03 kre 951 952 * history.c: 953 Fix editing mistake, remove ) from func call that is now gone. 954 9552018-09-13 03:26 christos 956 957 * history.c: more efficient to use decode_result :-) Pointed out by 958 kre@ 959 9602018-09-13 00:10 christos 961 962 * history.c: PR/53597: Yasuhiro Horimoto: Avoid segmentation fault 963 in bad history file. 964 9652018-06-25 09:25 pgoyette 966 967 * readline.c, readline/readline.h: Sync with HEAD 968 9692018-06-09 19:41 christos 970 971 * readline.c, readline/readline.h: Provide more compatibility with 972 readline headers; now python-3.6.5 works when changing 'readline' 973 -> 'edit' in setup.py. Revert previous conditional setting of 974 unbuffered. 975 9762018-05-21 06:35 pgoyette 977 978 * filecomplete.c, TEST/test_filecompletion.c: Sync with HEAD 979 9802018-05-04 22:38 christos 981 982 * filecomplete.c: fix uninitialized 983 9842018-05-04 18:39 abhinav 985 986 * filecomplete.c, TEST/test_filecompletion.c: Handle filename 987 autocompletion when the cursor is at a backslash or quote 988 character 989 990 For example, handle following case: $ touch 'foo bar' $ 991 ls foo\<TAB> --> $ ls foo\ bar 992 993 Also add test cases for this. 994 995 Thanks to Christos for review 996 9972018-05-02 10:45 abhinav 998 999 * filecomplete.c: Add '*' and '[' to the list of characters which 1000 need escaping during autocompletion 1001 10022018-02-26 18:36 christos 1003 1004 * common.c, search.c: PR/53058: Nikhil Benesch: use correctly typed 1005 variables (wchar_t vs wint_t) as parameters. 1006 10072018-01-01 23:32 christos 1008 1009 * el.c, readline.c, tty.c, tty.h: Only FLUSH if we are ending 1010 libedit; DRAIN if we suspend for readline. This allows pasting 1011 multiline buffers (Gerry Swislow) 1012 10132017-12-23 19:25 uwe 1014 1015 * history.c: The order in which the arguments to a function are 1016 evaluated is undefined, so don't use va_arg() twice. 1017 1018 PR lib/52849 1019 10202017-12-08 17:56 christos 1021 1022 * readline.c: For applications that don't issue their own prompt 1023 (like python) don't set unbuffered unless they've already printed 1024 the prompt. This avoids printing the prompt before the 1025 application has a chance to process the input line. From sjg@ 1026 10272017-10-27 20:16 abhinav 1028 1029 * filecomplete.c: Add NULL check after doing memory allocation at a 1030 couple of places 1031 1032 ok christos@ 1033 10342017-10-15 21:17 abhinav 1035 1036 * TEST/test_filecompletion.c: Add copyright and rcs header to the 1037 test program. Also, remove a test case which was not supposed to 1038 be there. (While that test case works with the changes I 1039 committed, testing that test case with the test program is not 1040 possible in its current form. I'm working on that.) 1041 10422017-10-15 20:59 abhinav 1043 1044 * filecomplete.c, TEST/Makefile, TEST/test_filecompletion.c: Add 1045 support for escaping special characters when doing filename 1046 completion. 1047 1048 For instance if the file name is "foo bar": $ ls foo<TAB> should 1049 get autocompleted to: $ ls foo\ bar 1050 1051 Works for similar other characters too, which need escaping. 1052 1053 Also, add an accompanying test program to ensure the escaping is 1054 correct in various scenarios (within quotes, without quotes, with 1055 other special characeters) 1056 1057 Thanks to Christos for reviews, help and feedback. 1058 10592017-10-11 08:49 abhinav 1060 1061 * chared.c: Fix typo in comment 1062 10632017-09-17 10:10 kre 1064 1065 * readline.c: PR lib/52547 - read_history (readline.c) should now 1066 sets history_length. 1067 1068 Patch from Yen Chi Hsuan in the PR, extracted from Apple's 1069 version of readline.c, then modified by me to be consistent about 1070 what the return value really is. 1071 10722017-09-16 22:40 abhinav 1073 1074 * filecomplete.c: Fix indentation (convert spaces to tab) 1075 10762017-09-05 20:07 christos 1077 1078 * el.c, el.h, readline.c, tty.c: For readline emulation, don't 1079 reset the tty to "sane" (cooked) mode if we did not start this 1080 way. Also set and reset the tty on entry and exit from readline() 1081 since this is what readline does. 1082 10832017-09-02 08:48 wiz 1084 1085 * editline.3: Remove trailing whitespace; convert Xr readline to Nm 1086 readline, since we won't get a readline man page in base. 1087 10882017-09-01 12:19 christos 1089 1090 * editline.3, hist.h, histedit.h, history.c, readline.c, 1091 readline/readline.h: PR/51517: Jay West: Tty settings not 1092 restored on exit PR/51518: Jay West: prompt is interleaved with 1093 client output 1094 1095 Both these issues are caused by rl_restore_handler not DTRT; fix 1096 it so that it kills the internal libedit state completely. This 1097 is inefficient, but it works. 1098 1099 Also fix: 1. add append_history()/H_NSAVE_FP 2. call the 1100 rl_startup_hook before printing the first prompt as documented. 1101 callint it from rl_initialize breaks python, because the 1102 callback ends up being invoked before the readline module is 1103 installed, and we end up dereferencing a NULL pointer. 3. 1104 add el_resize_terminal. 1105 1106 With those changes, s/lreadline/ledit/g in python works. 1107 11082017-07-23 16:41 snj 1109 1110 * Makefile, editline.3, editrc.5, el.c, el.h, literal.c, literal.h, 1111 prompt.c, read.c, refresh.c, refresh.h, terminal.c: Pull up 1112 following revision(s) (requested by kre in ticket #102): 1113 lib/libedit/Makefile: 1.64-1.65 lib/libedit/editline.3: 1114 1.94-1.96 lib/libedit/editrc.5: 1.33 lib/libedit/el.c: 1115 1.93-1.94 lib/libedit/el.h: 1.42 lib/libedit/literal.c: 1116 1.1-1.3 lib/libedit/literal.h: 1.1-1.2 lib/libedit/prompt.c: 1117 1.27 lib/libedit/read.c: 1.103 lib/libedit/refresh.c: 1118 1.52-1.54 lib/libedit/refresh.h: 1.11 1119 lib/libedit/terminal.c: 1.33 Make the default editrc file be 1120 $EDITRC (from env) if set, falling back to $HOME/.editrc 1121 otherwise. Better support for this in sh coming. -- Include 1122 EDITRC in doc. -- mention the limitation of the literal sequence 1123 delimiter. -- - handle literal escape sequence printing. - 1124 factor out common code in allocation and freeing of the display. 1125 -- - add literal sequence handling. -- remove unused variable -- 1126 add literal escape sequence support, patterned after the tcsh 1127 ones. -- fix comment -- Fix an obvious, but almost invisible 1128 typo (avoid some core dumps). -- Allow wide characters (properly 1129 encoded as byte strings according to LC_CTYPE) to be (perhaps 1130 part of) the "invisible" characters in a prompt, or the required 1131 prompt character which follows the literal sequence (this 1132 character must be one with a printing column width >= 1). The 1133 literal indicator character (which is just a marker, and not 1134 printed anywhere) (the PSlit parameter in sh(1)) can also be a 1135 wide char (passed to libedit as a wchar_t, encoded as that by 1136 sh(1) or other applications that support this.) Note: this has 1137 currently only been tested with everything ascii (C locale). -- 1138 Remove workaround for ancient HTML generation code. 1139 11402017-07-03 23:32 wiz 1141 1142 * editline.3: Remove workaround for ancient HTML generation code. 1143 11442017-06-30 22:26 snj 1145 1146 * literal.c: file literal.c was added on branch netbsd-8 on 1147 2017-07-23 14:41:26 +0000 1148 11492017-06-30 22:26 snj 1150 1151 * literal.h: file literal.h was added on branch netbsd-8 on 1152 2017-07-23 14:41:26 +0000 1153 11542017-06-30 22:26 kre 1155 1156 * Makefile, literal.c, literal.h, refresh.c: 1157 Allow wide characters (properly encoded as byte strings according 1158 to LC_CTYPE) to be (perhaps part of) the "invisible" characters 1159 in a prompt, or the required prompt character which follows the 1160 literal sequence (this character must be one with a printing 1161 column width >= 1). The literal indicator character (which is 1162 just a marker, and not printed anywhere) (the PSlit parameter in 1163 sh(1)) can also be a wide char (passed to libedit as a wchar_t, 1164 encoded as that by sh(1) or other applications that support 1165 this.) 1166 1167 Note: this has currently only been tested with everything ascii 1168 (C locale). 1169 11702017-06-29 04:54 kre 1171 1172 * literal.c: 1173 Fix an obvious, but almost invisible typo (avoid some core 1174 dumps). 1175 11762017-06-28 01:29 christos 1177 1178 * refresh.c: fix comment 1179 11802017-06-28 01:25 christos 1181 1182 * Makefile, el.c, el.h, literal.c, literal.h, prompt.c: add literal 1183 escape sequence support, patterned after the tcsh ones. 1184 11852017-06-28 01:24 christos 1186 1187 * read.c: remove unused variable 1188 11892017-06-28 01:23 christos 1190 1191 * refresh.c, refresh.h: - add literal sequence handling. 1192 11932017-06-28 01:23 christos 1194 1195 * terminal.c: - handle literal escape sequence printing. - factor 1196 out common code in allocation and freeing of the display. 1197 11982017-06-28 01:22 christos 1199 1200 * editline.3: mention the limitation of the literal sequence 1201 delimiter. 1202 12032017-06-27 03:22 kre 1204 1205 * editline.3, editrc.5: 1206 Include EDITRC in doc. 1207 12082017-06-27 02:47 kre 1209 1210 * el.c: 1211 Make the default editrc file be $EDITRC (from env) if set, 1212 falling back to $HOME/.editrc otherwise. Better support for 1213 this in sh coming. 1214 12152017-05-22 21:16 christos 1216 1217 * chartype.h: Add DragonFly. 1218 12192017-04-26 04:52 pgoyette 1220 1221 * editline.3, filecomplete.c, filecomplete.h, readline.c: Sync with 1222 HEAD 1223 12242017-04-21 18:53 bouyer 1225 1226 * editline.3, filecomplete.c, filecomplete.h, hist.c, readline.c: 1227 Sync with HEAD 1228 12292017-04-21 07:38 abhinav 1230 1231 * filecomplete.c, filecomplete.h, readline.c: When doing filename 1232 autocompletion, append a trailing slash at the end of directory 1233 names. We already do this when there is only one completion 1234 option but in case of of multiple completion options, it wasn't 1235 being done. 1236 1237 ok christos@ 1238 12392017-04-10 17:02 abhinav 1240 1241 * editline.3: Add missing argument for H_SET. 1242 1243 ok christos@ 1244 12452017-03-20 07:56 pgoyette 1246 1247 * chartype.c, hist.c, readline.c: Sync with HEAD 1248 12492017-03-05 20:23 christos 1250 1251 * hist.c: one extra char for NUL. 1252 12532017-03-05 18:30 christos 1254 1255 * hist.c: Grow the buffer for event search if there was not enough 1256 space. From Gerry Swislow 1257 12582017-01-09 04:09 christos 1259 1260 * readline.c: Make sure we take into account history_base when 1261 computing negative history offsets. (Gerry Swinslow) 1262 12632017-01-09 03:54 christos 1264 1265 * chartype.c: Make sure that argv is NULL terminated since 1266 functions like tty_stty rely on it to be so (Gerry Swinslow) 1267 12682017-01-07 09:56 pgoyette 1269 1270 * hist.c, read.c: Sync with HEAD. (Note that most of these changes 1271 are simply $NetBSD$ tag issues.) 1272 12732016-12-11 16:47 christos 1274 1275 * read.c: PR/51706: Amir Plivatsky: Fix memory leak 1276 12772016-11-07 16:30 christos 1278 1279 * hist.c: Change the way the built-in history works; some programs 1280 enter history with the trailing newline, others don't so don't 1281 make any assumptions about it when printing. Also print the 1282 correct event number (generated), separate the event number from 1283 the event with a tab, and visually encode the string (don't 1284 encode tabs and spaces though). 1285 12862016-11-04 15:48 pgoyette 1287 1288 * filecomplete.c, readline.c, readline/readline.h: Sync with HEAD 1289 12902016-10-31 18:46 abhinav 1291 1292 * filecomplete.c: Fix file name auto completion in one specific 1293 case. 1294 1295 For example if you do $mkdir -p /tmp/dir1/dir2 1296 1297 Then: $ls /tmp/di <TAB> auto completes to $ls /tmp/dir1/ 1298 1299 Hitting <TAB> again auto completes to $ls /tmp/dir1/dir2 1300 1301 Whereas it should auto complete to $ls /tmp/dir1/dir2/ 1302 1303 Essentially, in cases like above where you have to hit <TAB> 1304 twice to get to the match and there is only one match (because 1305 only one file/sub-directory) then auto complete doesn't work 1306 correctly. It doesn't append a trailing slash (in case of 1307 directory) or a space (in case of a file) to the match name. 1308 1309 I have tested file name completion in sh(1) and symbol completion 1310 in gdb after this change. 1311 13122016-10-28 20:32 christos 1313 1314 * readline/readline.h: export rl_done 1315 13162016-10-28 20:32 christos 1317 1318 * readline.c: pass the stream to the getc function 1319 13202016-09-01 15:23 mbalmer 1321 1322 * readline.c: fix typo 1323 13242016-08-24 15:10 christos 1325 1326 * readline.c, readline/readline.h: more compatible with readline 1327 history functions. 1328 13292016-06-02 23:40 christos 1330 1331 * readline.c: Fix previous to better match readline behavior (Ingo 1332 Schwarze) 1333 13342016-06-02 17:11 christos 1335 1336 * readline.c: From Ingo Schwarze: 1337 1338 In libedit, the only way how H_ENTER can fail is memory 1339 exhaustion, too, and of course it is handled gracefully, 1340 returning -1 from history(). So of course, we will continue to 1341 handle it gracefully in add_history() as well, but we are free to 1342 decide what to do with the library state in this case because GNU 1343 just dies... 1344 1345 I think the most reasonable course of action is to simply not 1346 change the library state in any way when add_history() fails due 1347 to memory exhaustion, but just return. 1348 1349 If H_ENTER does not fail, we know that the history now contains 1350 at least one entry, so there is no need any longer to check the 1351 H_GETSIZE return value. And we can of course always set 1352 current_history_valid. 1353 1354 While testing these changes, i noticed three problems so closely 1355 related that i'd like to fix them in the same diff. 1356 1357 1. libedit has the wrong prototype for add_history(). 1358 GNU readline-6.3 defines it as void add_history(const char 1359 *). 1360 Of course, that is very stupid - no way to report problems to 1361 the caller! But the whole point of a compatibility mode is 1362 being compatible, so we should ultimately change this. 1363 Of course, changing the prototype of a public symbol requires 1364 a libedit major bump. I don't want to do that casually. 1365 Rather, i will take a note and change the prototype the next 1366 time we need a libedit major bump for more important reasons. 1367 For now, let's just always return 0. 1368 1369 2. While *implicitely* pushing an old entry off the history 1370 increments history_base in GNU readline, testing reveals that 1371 *explicitly* deleting one does not. Again, this is not 1372 documented, but it applies to both remove_history() and 1373 stifle_history(). So delete history_base manipulation 1374 from stifle_history(), which also allows to simplify the 1375 code and delete two automatic variables. 1376 1377 3. GNU readline add_history(NULL) crashes with a segfault. 1378 There is nothing wrong with having a public interface 1379 behave that way. Many standard interfaces do, including 1380 strlen(3). Such crashes can even be useful to catch 1381 buggy application programs. 1382 In libedit/readline.c rev. 1.104, Christos made add_history() 1383 silently ignore this coding error, according to the commit 1384 message to hide a bug in nslookup(1). That change was never 1385 merged to OpenBSD. I strongly disagree with this change. 1386 If nslookup(1) is still broken, that program needs to be 1387 fixed instead. In any case, delete the bogus check; hiding 1388 bugs is dangerous. 1389 13902016-05-31 21:25 christos 1391 1392 * readline.c: remove the right history entry (Ingo Schwarze) 1393 13942016-05-25 15:01 christos 1395 1396 * read.c: abstract read code to a single function (Ingo Schwarze) 1397 13982016-05-24 21:31 christos 1399 1400 * read.c: el_map.alt can't be NULL here (Ingo Schwarze) 1401 14022016-05-24 19:42 christos 1403 1404 * Makefile, read.c: remove debug read (Ingo Schwarze) 1405 14062016-05-24 17:00 christos 1407 1408 * el.h, keymacro.c, read.c: From Ingo Schwarze: 1409 1410 Reduce obfuscation of errno handling. There is only one purpose 1411 non-local errno handling is needed for: Inside el_wgets(), 1412 several functions call down indirectly to el_wgetc(), many of 1413 them via the dispatch table. When el_wgetc() fails, it does 1414 properly report failure, but then various cleanup is done which 1415 may clobber errno. But when returning due to failure, el_wgets() 1416 wants to have errno set to the reason of the original read 1417 failure, not to the reason of some subsequent failure of some 1418 cleanup operation. So el_wgetc() needs to save errno, and if 1419 it's non-zero, el_wgets() needs to restore it on failure. 1420 1421 This core logic is currently obscured by the fact that el_errno 1422 is set and inspected at some additional places where it isn't 1423 needed. Besides, since el_wgetc() and and el_wgets() are both in 1424 read.c, el_errno does not need to be in struct editline, it can 1425 and should be local to read.c in struct el_read_t. 1426 1427 Let's look at what can be simplified. 1428 1429 1. keymacro_get() abuses el_errno instead of having a proper 1430 error return code. Adding that error return code is easy 1431 because node_trav() already detects the condition and an 1432 adequate code is already defined. Returning it, testing 1433 for it in read_getcmd(), and returning with error from there 1434 removes the need to inspect el_errno from el_wgets() after 1435 calling read_getcmd(). 1436 Note that resetting lastchar and cursor and clearing 1437 buffer[0] 1438 is irrelevant. The code returns from el_wgets() right 1439 afterwards. 1440 Outside el_wgets(), these variables are no longer relevant. 1441 When el_wgets() is called the next time, it will call 1442 ch_reset() 1443 anyway, resetting the two pointers. And as long as lastchar 1444 points to the beginning of the buffer, the contents of the 1445 buffer won't be used for anything. 1446 1447 2. read_getcmd() doesn't need to set el_errno again after 1448 el_wgetc() 1449 failure since el_wgetc() already did so. While here, remove 1450 the silly "if EOF or error" comments from the el_wgetc() 1451 return value tests. It's a public interface documented in a 1452 manual, so people working on the implementation can obviously 1453 be expected to know how it works. It's a case of 1454 1455 count++; /* Increment count. */ 1456 1457 3. In the two code paths of el_wgets() that lead up to "goto 1458 noedit", 1459 there is no need to save the errno because nothing that might 1460 change it happens before returning. 1461 1462 For clarity, since el_wgets() is the function restoring the 1463 errno, also move initializing it to the same function. 1464 1465 Finally, note that restoring errno when the saved value is zero 1466 is wrong. No library code is ever allowed to clear a previously 1467 set value of errno. Only application programs are allowed to do 1468 that, and even they usually don't need to do so, except when 1469 using certain ill-designed interfaces like strtol(3). 1470 1471 I tested that the behaviour remains sane in the following cases, 1472 all during execution of el_wgets(3) and with a signal handler for 1473 USR1 installed without SA_RESTART. 1474 1475 * Enter some text and maybe move around a bit. 1476 Then send a USR1 signal. 1477 The signal gets processed, then read_char() resumes reading. 1478 Send another USR1 signal. 1479 Now el_wgets() sets errno=EINTR and returns -1. 1480 1481 * Press Ctrl-V to activate ed-quoted-insert. 1482 Then send a USR1 signal. 1483 The signal gets processed, then read_char() resumes reading. 1484 Send another USR1 signal. 1485 ed_quoted_insert() returns ed_end_of_file(), i.e. CC_EOF, 1486 and el_wgets() returns 0. 1487 1488 * Press a key starting a keyboard macro. 1489 Then send a USR1 signal. 1490 The signal gets processed, then read_char() resumes reading. 1491 Send another USR1 signal. 1492 Now el_wgets() sets errno=EINTR and returns -1. 1493 1494 * Press : to enter builtin command mode. 1495 Start typing a command. 1496 Then send a USR1 signal. 1497 The signal gets processed, then read_char() resumes reading. 1498 Send another USR1 signal. 1499 Now c_gets() returns -1, ed_command() beeps and returns 1500 CC_REFRESH, 1501 and el_wgets() resumes operation as it should. 1502 1503 I also tested with "el_set(el, EL_EDITMODE, 0)", and it returns 1504 the right value and sets errno correctly. 1505 15062016-05-23 01:54 christos 1507 1508 * editline.3, editrc.5: documentation improvements (Ingo Schwarze) 1509 15102016-05-22 21:44 christos 1511 1512 * chared.c, chared.h, common.c, el.c, read.c, read.h: Stop the read 1513 module from poking the el_chared.c_macro data structure currently 1514 belonging to the chared module. The read module does so from 1515 three of its functions, while no other module uses the macro 1516 data, not even the chared module itself. That's quite logical 1517 because macros are a feature of input handling, all of which is 1518 done by the read module, and none by the chared module. So move 1519 the data into the read modules's own opaque data structure, 1520 struct el_read_t. 1521 1522 That simplifies internal interfaces in several respects: The 1523 semi-public chared.h has one fewer struct, one fewer #define, and 1524 one fewer member in struct el_chared_t; all three move to one 1525 single C file, read.c, and are now module-local. And the 1526 internal interface function ch_reset() needs one fewer argument, 1527 making the code of many functions in various modules more 1528 readable. 1529 1530 The price is one additional internal interface function, 1531 read_end(), 10 lines long including comments, called publicly 1532 from exactly one place: el_end() in el.c. That's hardly an 1533 increase in complexity since most other modules already have 1534 their *_end() function, read.c was the odd one out not having 1535 one. 1536 1537 From Ingo Schwarze 1538 15392016-05-21 19:06 christos 1540 1541 * editline.3: Fix the prototype used by EL_GETCFN, mention the 1542 associated typedef name, document the return values, expand the 1543 list of affected functions, warn against using EL_GETCFN, and 1544 clarify some wording and notation. (Ingo Schwarze) 1545 15462016-05-13 17:55 christos 1547 1548 * readline.c: From Bastian Maerkisch, via Igno Schwarze: 1549 1550 Even though section "2.3.3 Information About the History List" of 1551 the history(3) info(1) manual only says 1552 1553 -- Function: int where_history (void) 1554 Returns the offset of the current history element. 1555 1556 which maybe isn't completely clear, a plausible implementation is 1557 that the offset returned is the same offset that can be used for 1558 history_set_pos(), i.e. that it is 0 for the oldest entry and 1559 increases with time, and that's how the GNU implementation 1560 behaves indeed. 1561 1562 The libedit implementation, on the other hand, returns 1 for the 1563 newest entry and increases going back in time. 1564 15652016-05-09 23:46 christos 1566 1567 * chared.c, chared.h, chartype.c, chartype.h, common.c, el.c, el.h, 1568 emacs.c, hist.c, hist.h, keymacro.c, keymacro.h, makelist, map.c, 1569 map.h, parse.c, parse.h, prompt.c, prompt.h, read.c, read.h, 1570 refresh.c, refresh.h, search.c, search.h, sig.c, sig.h, sys.h, 1571 terminal.c, terminal.h, tty.c, tty.h, vi.c: 1572 s/protected/libedit_private/g 1573 15742016-05-09 23:38 christos 1575 1576 * Makefile, editline.c, sys.h: Instead of compiling all the source 1577 files together in one big file, use protected visibility to 1578 achieve the same effect. 1579 15802016-05-09 23:37 christos 1581 1582 * eln.c: Elide gcc warning about intermediate const casts caused by 1583 visibility change. 1584 15852016-05-09 23:27 christos 1586 1587 * editline.3, editline.7, readline.c: GNU readline(3) regards 1588 history chronologically, that is, from the perspective of the 1589 dawn of time, so "next" means "newer" and "previous" means 1590 "older". Libedit, by contrast, uses reverse chronology and 1591 regards history from the perspective of the present, such that 1592 "next" means "longer ago" and "previous" means "not so long ago". 1593 1594 The following patch fixes previous_history() and next_history() 1595 as proposed by Bastian Maerkisch. 1596 1597 But there is a related problem demonstrated by Bastian's 1598 regression tests that his patch did not fix: next_history() can 1599 advance not only to the newest entry, but beyond it, which core 1600 libedit cannot do. So that feature must be implemented locally 1601 in readline.c. 1602 1603 With that, the last of Bastians tests is fixed, 1604 test_movement_direction(). 1605 1606 This patch also improves libedit documentation to more clearly 1607 state what "previous" and "next" mean. GNU readline 1608 documentation is just as unclear, but we can't easily fix that 1609 since libedit doesn't include its own readline.3 manual. 1610 1611 (Ingo Schwarze) 1612 16132016-05-09 23:25 christos 1614 1615 * readline.c: The libedit implementation of history_get() also 1616 differs from the GNU implementation: libedit goes to the entry 1617 with the given number stored in the HistEvent structure, while 1618 GNU subtracts history_base, then advances that many entries from 1619 the oldest one. If entries were removed in between, GNU advances 1620 further than libedit. 1621 1622 The call sequence H_CURR, H_DELDATA, H_CURR, H_NEXT_EVDATA looks 1623 weird, as if part of that must somehow be redundant. But 1624 actually, the user interface is so counter-intuitive that every 1625 single step is really required. 1626 1627 - The first H_CURR is needed to be able to go back after an 1628 error. 1629 - The H_DELDATA is needed to move the cursor. Even though it 1630 takes 1631 a pointer to ev, that structure is not filled in when the call 1632 succeeds. H_DELDATA only moves the cursor, it doesn't tell us 1633 the new event number. 1634 - Consequently, the second H_CURR is required to get ev.num 1635 filled 1636 in. But it doesn't return the data because ev has no field 1637 for 1638 that. 1639 - So even though the cursor is already positioned correctly, 1640 H_NEXT_EVDATA is needed as the final step merely to get the 1641 data. 1642 1643 (Ingo Schwarze) 1644 16452016-05-08 22:15 christos 1646 1647 * readline.c: In stiffle_history(), trim excessive entries from the 1648 history and advance history_base like the GNU implementation 1649 does. (from Bastian Maerkisch) 1650 16512016-05-06 23:01 christos 1652 1653 * readline.c: fix logic (Ingo Schwarze) 1654 16552016-05-02 18:48 christos 1656 1657 * chartype.c, chartype.h, el.c, el.h, terminal.c: eliminate static 1658 buffer with custom resizing code. 1659 16602016-05-02 18:35 christos 1661 1662 * chartype.h, refresh.c: fix typos from Pedro Giffuni @FreeBSD 1663 16642016-05-02 16:12 wiz 1665 1666 * Makefile: Add missing backslash that broke build. 1667 16682016-05-02 15:01 christos 1669 1670 * Makefile: Add more MLINKS, sort 1671 16722016-05-02 14:51 wiz 1673 1674 * editline.7: Fix Dd argument. 1675 16762016-05-02 14:43 christos 1677 1678 * editline.7: Add more explicit xrefs 1679 16802016-05-02 11:39 wiz 1681 1682 * editline.7: Fix Dd argument. 1683 16842016-04-28 17:50 christos 1685 1686 * Makefile, editline.3, editline.7, editrc.5: new man page from 1687 Ingo Schwarze. 1688 16892016-04-28 14:27 christos 1690 1691 * search.c: Initialize patbuf (Ingo Schwarze) 1692 16932016-04-19 21:50 christos 1694 1695 * el.c, el.h, histedit.h, read.c, read.h: From Ingo Schwarze: - 1696 Put the data type el_rfunc_t into the public header <histedit.h>. 1697 - Make el_read in struct editline an opaque pointer rather 1698 than an embedded struct. - Do not include "read.h" everywhere, 1699 but only in the two files needing access to el_read, read.c 1700 and el.c. - To functions that don't need more, pass the struct 1701 el_read_t * rather than the full EditLine *. - Of course, 1702 that means that read_init() can now fail from memory 1703 exhaustion, but it's easy to clean up after that. 1704 17052016-04-18 19:01 christos 1706 1707 * Makefile, chared.c, common.c, editline.c, el.h, emacs.c, 1708 historyn.c, keymacro.c, makelist, map.c, map.h, read.c, 1709 readline.c, search.c, terminal.c, tokenizern.c, tty.c, vi.c: From 1710 Ingo Schwarze: * Replace fcns.c by a shorter and simpler func.h 1711 and include it only in the one file needing it, map.c. * 1712 Combine help.h and help.c into a simplified help.h and 1713 include it only in the one file needing it, map.c. * Check the 1714 very simple, static files editline.c, historyn.c, and 1715 tokenizern.c into CVS rather than needlessly generating them. * 1716 So we no longer autogenerate any C files. :-) * Shorten and 1717 simplify makelist by deleting the options -n, -e, -bc, and 1718 -m; the latter was unused and useless in the first place. * 1719 Move the declaration of el_func_t from fcns.h to the header 1720 actually needing it, map.h. Since that header is already 1721 included by el.h for unrelated reasons, that makes el_func_t 1722 just as globally available as before. * No longer include the 1723 simplified fcns.h into el.h, include it directly into the *.c 1724 files needing it. 1725 17262016-04-17 20:39 christos 1727 1728 * common.c, editrc.5, map.c: Remove empty callbacks (Ingo 1729 Schwartze) 1730 17312016-04-12 13:15 christos 1732 1733 * read.c: FIONREAD takes int as an argument (Ingo Schwarze) 1734 17352016-04-12 02:16 christos 1736 1737 * keymacro.c, keymacro.h, map.c, read.c: From Ingo Schwarze: 1738 1739 * Delete the stubs of the XK_EXE mechanism that was never 1740 implemented. 1741 From a security, stability, and simplicity perspective, i 1742 would 1743 consider implementing it a truly terrible idea, so let's 1744 better 1745 get rid of it. 1746 1747 * Do not use the local variable "num" in el_wgets() alternately 1748 for 1749 two completely different purposes. Only use it for the number 1750 of characters read, as stated in the comment (or -1 as long as 1751 that number is still unknown), not for the (more or less 1752 boolean) 1753 return value of read_getcmd(). Actually, there is no need at 1754 all to save the latter return value after testing it once. 1755 1756 * The function read_getcmd() has very unusual return values: 1757 It returns -1 for success and 0 for EOF/error. Switch that 1758 around 1759 to 0 for success and -1 for EOF/error to be less confusing, 1760 and 1761 get rid of the OKCMD preprocessor macro. 1762 1763 * Get rid of one #ifdef section in el_wgets() by using 1764 el->el_chared.c_macro directly at the only place 1765 where it is used. 1766 1767 * Delete the unused MIN() macro. 1768 17692016-04-12 00:30 christos 1770 1771 * parse.c: Fix indentation, Ingo Schwarze 1772 17732016-04-11 20:56 christos 1774 1775 * chared.c, chartype.c, chartype.h, el.c, eln.c, history.c, 1776 keymacro.c, makelist, map.c, parse.c, prompt.c, read.c, 1777 refresh.c, search.c, sig.c, sys.h, terminal.c, tokenizer.c, 1778 tty.c, vi.c: Get rid of private/public; keep protected (Ingo 1779 Schwarze) 1780 17812016-04-11 18:06 christos 1782 1783 * chartype.c, chartype.h, history.c, tokenizer.c: chartype cleanups 1784 from Ingo Schwarze: 1785 1786 - The file tokenizer.c no longer uses chartype.h, 1787 so don't include the header. 1788 1789 - The dummy definitions of ct_{de,en}code_string() for the 1790 NARROWCHAR case are only used in history.c, so move them 1791 there. 1792 1793 - Now the whole content of chartype.h is for the wide character 1794 case only. So remove the NARROWCHAR ifdef and include the 1795 header only in the wide character case. 1796 1797 - In chartype.h, move ct_encode_char() below the comment 1798 explaining it. 1799 1800 - No more need for underscores before ct_{de,en}code_string(). 1801 1802 - Make the conversion buffer resize functions private. 1803 They are only called from the decoding and encoding functions 1804 inside chartype.c, and no need can possibly arise to call them 1805 from anywhere else. 1806 18072016-04-11 02:50 christos 1808 1809 * chared.c, chared.h, chartype.c, chartype.h, common.c, el.c, el.h, 1810 eln.c, emacs.c, filecomplete.c, filecomplete.h, hist.c, hist.h, 1811 history.c, keymacro.c, keymacro.h, map.c, map.h, parse.c, 1812 parse.h, prompt.c, prompt.h, read.c, refresh.c, search.c, 1813 search.h, terminal.c, terminal.h, tokenizer.c, tty.c, tty.h, 1814 vi.c: Char -> wchar_t from Ingo Schwarze. 1815 18162016-04-11 02:22 christos 1817 1818 * chared.c, chartype.h, common.c, el.c, eln.c, filecomplete.c, 1819 hist.c, hist.h, history.c, keymacro.c, makelist, map.c, parse.c, 1820 read.c, refresh.c, search.c, terminal.c, tokenizer.c, tty.c, 1821 vi.c: more macro WIDECHAR undoing from Ingo Schwarze. 1822 18232016-04-09 20:47 christos 1824 1825 * filecomplete.c, vi.c: Change some 0's to NULL's from Pedro 1826 Giffuni 1827 18282016-04-09 20:43 christos 1829 1830 * chared.c, chartype.c, chartype.h, common.c, el.c, eln.c, emacs.c, 1831 hist.c, keymacro.c, map.c, read.c, refresh.c, search.c, 1832 terminal.c, tty.c, vi.c: More WIDECHAR elimination (Ingo 1833 Schwarze) 1834 18352016-03-23 23:27 christos 1836 1837 * Makefile, chartype.c, chartype.h, config.h, el.c, el.h, eln.c, 1838 hist.c, hist.h, history.c, keymacro.c, makelist, read.c, 1839 readline.c, search.c, sys.h, terminal.c, TEST/Makefile: Start 1840 removing the WIDECHAR ifdefs; building without it has stopped 1841 working anyway. (Ingo Schwarze) 1842 18432016-03-22 02:38 christos 1844 1845 * terminal.c: put back NUL check (Ingo Schwarze) 1846 18472016-03-22 02:34 christos 1848 1849 * tty.c: Fix reversed condition in tty_end() (Ingo Schwarze) Also 1850 don't succeed if calling setup twice. 1851 18522016-03-07 01:05 christos 1853 1854 * chartype.h: Remove advertising clause. 1855 18562016-03-02 20:24 christos 1857 1858 * Makefile, chartype.h, common.c, read.c, refresh.c, terminal.c, 1859 vi.c: PR/50880: David Binderman: Remove redundant code. While 1860 here, fix all debugging formats. 1861 18622016-02-29 01:54 christos 1863 1864 * TEST/rl1.c: convert to 2 clause 1865 18662016-02-29 00:02 christos 1867 1868 * chartype.c, eln.c: remove 4 clause licenses. 1869 18702016-02-27 19:13 christos 1871 1872 * tty.c, tty.h: PR/50863: John Hein: libedit el_end() messes up 1873 term settings if piped Keep track if we initialized the tty, and 1874 only reset it if we did. 1875 18762016-02-25 15:59 wiz 1877 1878 * editline.3: Use \- for minus sign, use Ev, use Er. 1879 18802016-02-24 20:45 christos 1881 1882 * editline.3: Fix el_{w,}getc documentation (Ingo Schwarze) 1883 18842016-02-24 19:28 christos 1885 1886 * editline.3: Fixes from OpenBSD via Ingo Schwarze: 1) Missing 1887 comma after tok_str in NAME. OpenBSD rev. 1.38 Sep 10, 2015 1888 (schwarze) 2) Style: void in argument list. OpenBSD rev. 1889 1.39 Sep 14, 2015 (schwarze) 3) English punctuation: stray 1890 comma. OpenBSD rev. 1.37 Mar 13, 2015 (jmc) 1891 18922016-02-24 18:20 christos 1893 1894 * chartype.c, chartype.h, read.c: Tuck in mbstate_t to the wide 1895 char version only to avoid exposing the zeroing hack and doing it 1896 in the narrow case. 1897 18982016-02-24 18:13 christos 1899 1900 * chartype.c, chartype.h, el.c, el.h, eln.c, read.c, read.h, 1901 readline.c: Make the read_char function always take a wchar_t * 1902 argument (Ingo Schwarze) 1903 19042016-02-24 15:29 christos 1905 1906 * chared.c: A very simple, non-intrusive patch to fix a segfault 1907 (and a functional error) in c_gets(), file chared.c. 1908 1909 Run any program using libedit in the default way. At the 1910 el_[w]gets() prompt, invoke ed-command (for example, in emacs 1911 mode, press the escape key, then type the letter 'x'). You 1912 should see a ": " prompt. Type the letter 'x' again. Now press 1913 the backspace key a few times, looking at the screen after each 1914 key press: 1915 1916 - The 1st BS deletes the 'x'. 1917 - The 2nd BS deletes the blank after the prompt. 1918 - The 3rd BS deletes the colon of the prompt. 1919 - The 4th BS moves the cursor up one line. 1920 - The 5th BS gives me "Segmentation fault (core dumped)". 1921 1922 Depending on your platform, it might take a few more or a few 1923 less backspaces for the buffer underrun to trigger the segfault, 1924 but you should be able to hit it sooner or later no matter what. 1925 1926 Run the same program again, connect again and invoke ed-command 1927 again. Now type: 'b', backspace, 'i', backspace, 'n', backspace, 1928 'd', enter. The "bind" command gets executed, even though you 1929 deleted what you typed before hitting enter. 1930 1931 From Ingo Schwatze. 1932 19332016-02-24 15:25 christos 1934 1935 * Makefile, chared.c, chartype.c, common.c, eln.c, keymacro.c, 1936 read.c, search.c: Get split el_getc and el_wgetc completely and 1937 call el_wgetc internally. Change some character constants to 1938 they wide versions. (Ingo Schwarze) 1939 19402016-02-17 20:47 christos 1941 1942 * Makefile, chared.c, chartype.c, chartype.h, common.c, el.c, el.h, 1943 filecomplete.c, hist.h, histedit.h, history.c, keymacro.c, 1944 makelist, map.c, parse.c, prompt.h, read.c, read.h, readline.c, 1945 refresh.c, sys.h, terminal.c, tokenizer.c, tty.c, vi.c, 1946 TEST/tc1.c, TEST/wtc1.c, readline/Makefile, readline/readline.h: 1947 whitespace and header sorting changes (Ingo Schwarze). No 1948 functional changes. 1949 19502016-02-16 23:53 christos 1951 1952 * chared.c, chared.h, chartype.c, common.c, el.h, emacs.c, 1953 filecomplete.c, hist.c, map.c, parse.c, read.c, refresh.c, 1954 search.c, tty.c, vi.c: More header cleanups from Ingo Schwarze. 1955 19562016-02-16 20:29 christos 1957 1958 * config.h, histedit.h, sys.h: - don't set _GNU_SOURCE. We are not 1959 supposed to make decisions for others. - don't special-case 1960 wcsdup() From Ingo Schwarze. 1961 19622016-02-16 20:11 christos 1963 1964 * common.c, el.h: get rid of bool_t (Ingo Schwarze) 1965 19662016-02-16 20:08 christos 1967 1968 * chared.c, chared.h, common.c, el.c, el.h, emacs.c, 1969 filecomplete.c, makelist, map.c, parse.c, readline.c, search.c, 1970 sig.c, tty.c, vi.c: more include file cleanup (Ingo Schwarze) 1971 19722016-02-16 16:54 christos 1973 1974 * sig.c: include errno.h 1975 19762016-02-16 16:53 christos 1977 1978 * chared.c, chared.h, chartype.c, common.c, el.c, el.h, eln.c, 1979 emacs.c, filecomplete.c, hist.c, hist.h, keymacro.c, makelist, 1980 map.c, parse.c, prompt.c, prompt.h, read.c, readline.c, 1981 refresh.c, refresh.h, search.c, search.h, sig.c, sig.h, 1982 terminal.c, terminal.h, tty.c, tty.h, vi.c: From Ingo Scharze: 1983 Let "el.h" include everything needed for struct editline, and 1984 don't include that stuff multiple times. That also improves 1985 consistency, also avoids circular inclusions, and also makes it 1986 easier to follow what is going on, even though not quite as nice. 1987 But it seems like the best we can do... 1988 19892016-02-16 15:08 christos 1990 1991 * chared.c, chartype.c, common.c, el.c, el.h, eln.c, emacs.c, 1992 filecomplete.c, hist.c, keymacro.c, makelist, map.c, parse.c, 1993 prompt.c, read.c, readline.c, refresh.c, search.c, sig.c, 1994 terminal.c, tty.c, vi.c: cleanup chartype.h includes (Ingo 1995 Schwarze) 1996 19972016-02-16 15:07 christos 1998 1999 * sig.c: one more 2000 20012016-02-16 15:06 christos 2002 2003 * chared.c, chared.h, chartype.c, common.c, el.c, el.h, emacs.c, 2004 filecomplete.c, hist.c, hist.h, keymacro.c, makelist, map.c, 2005 parse.c, prompt.c, prompt.h, read.c, readline.c, refresh.c, 2006 refresh.h, search.c, search.h, sig.h, terminal.c, terminal.h, 2007 tty.c, tty.h, vi.c: cleanup inclusion of histedit.h (Ingo 2008 Schwarze) 2009 20102016-02-16 15:04 christos 2011 2012 * sig.c: include explicitly errno.h since we use it. 2013 20142016-02-16 15:04 christos 2015 2016 * tty.h: No need to include "sys.h" from here; it is included from 2017 config.h 2018 20192016-02-16 00:36 christos 2020 2021 * readline.c: attribute unused 2022 20232016-02-15 23:53 christos 2024 2025 * terminal.c: OpenBSD term.c rev. 1.7 2002/11/29 20:13:39 deraadt 2026 spelling 2027 20282016-02-15 23:48 christos 2029 2030 * config.h, readline.c, sys.h: OpenBSD readline.c rev. 1.14 2031 2015/02/06 23:21:58 millert use SIZE_MAX 2032 20332016-02-15 22:58 christos 2034 2035 * readline.c, readline/readline.h: OpenBSD readline.c rev. 1.13 2036 2015/01/13 08:33:12 reyk rl_set_keyboard_input_timeout() for 2037 readline 4.2 compat 2038 20392016-02-15 22:56 christos 2040 2041 * eln.c: OpenBSD eln.c rev. 1.3 2011/11/27 21:46:44 pascal kill a 2042 C++-style comment 2043 20442016-02-15 22:38 christos 2045 2046 * TEST/Makefile: Compile with WIDECHAR the same way the main 2047 Makefile does (Ingo Schwarze) 2048 20492016-02-15 22:35 christos 2050 2051 * history.c: Don't free getline memory (Ingo Schwarze). 2052 20532016-02-15 18:35 christos 2054 2055 * sys.h: forgot one fgetln define 2056 20572016-02-15 17:14 christos 2058 2059 * config.h, sys.h: change tests for fgetln. 2060 20612016-02-15 16:53 christos 2062 2063 * el.c, history.c: Use getline for better portability. 2064 20652016-02-15 16:37 christos 2066 2067 * tokenizer.c: OpenBSD tokenizer.c rev. 1.8 2003/08/11 18:21:40 2068 deraadt don't increase amax on realloc failure 2069 20702016-02-15 16:35 christos 2071 2072 * terminal.c: OpenBSD term.c rev. 1.13 2009/12/11 18:58:59 jacekm 2073 fix two memory leaks 2074 20752016-02-15 16:30 christos 2076 2077 * history.c: Change the test for the size of encoded buffer to 2078 include the NULL, from OpenBSD; no functional change. 2079 20802016-02-15 16:29 christos 2081 2082 * sig.c: OpenBSD sig.c rev. 1.6 2001/12/06 04:26:00 deraadt save 2083 and restore errno in signal handler 2084 20852016-02-15 16:26 christos 2086 2087 * history.c: Use fparseln to avoid newline hacks. 2088 20892016-02-15 16:18 christos 2090 2091 * el.c: use fparseln() to avoid needing to deal with missing \n in 2092 the last line and also to handle comments automatically. 2093 20942016-02-14 18:06 christos 2095 2096 * chartype.h, eln.c: From Ingo Schwarze: 2097 2098 el_getc() for the WIDECHAR case, that is, the version in eln.c. 2099 For a UTF-8 locale, it is broken in four ways: 2100 2101 1. If the character read is outside the ASCII range, the 2102 function 2103 does an undefined cast from wchar_t to char. Even if wchar_t 2104 is internally represented as UCS-4, that is wrong and 2105 dangerous 2106 because characters beyond codepoint U+0255 get their high 2107 bits 2108 truncated, meaning that perfectly valid printable Unicode 2109 characters get mapped to arbitrary bytes, even the ASCII 2110 escape 2111 character for some Unicode characters. But wchar_t need not 2112 be implemented in terms of UCS-4, so the outcome of this 2113 function 2114 is undefined for any and all input. 2115 2116 2. If insufficient space is available for the result, the 2117 function 2118 fails to detect failure and returns garbage rather than -1 as 2119 specified in the documentation. 2120 2121 3. The documentation says that errno will be set on failure, but 2122 that doesn't happen either in the above case. 2123 2124 4. Even for ASCII characters, the results may be wrong if 2125 wchar_t 2126 is not using UCS-4. 2127 21282016-02-14 15:49 christos 2129 2130 * chared.c, chared.h, chartype.h, common.c, emacs.c, keymacro.c, 2131 makelist, map.c, parse.c, refresh.c, refresh.h, search.c, 2132 search.h, terminal.c, terminal.h, tty.c, vi.c: From Ingo 2133 Schwarze: 2134 2135 As we have seen before, "histedit.h" can never get rid of 2136 including the <wchar.h> header because using the data types 2137 defined there is deeply ingrained in the public interfaces of 2138 libedit. 2139 2140 Now POSIX unconditionally requires that <wchar.h> defines the 2141 type wint_t. Consequently, it can be used unconditionally, no 2142 matter whether WIDECHAR is active or not. Consequently, the 2143 #define Int is pointless. 2144 2145 Note that removing it is not gratuitious churn. Auditing for 2146 integer signedness problems is already hard when only fundamental 2147 types like "int" and "unsigned" are involved. It gets very hard 2148 when types come into the picture that have platform-dependent 2149 signedness, like "char" and "wint_t". Adding yet another layer 2150 on top, changing both the signedness and the width in a platform- 2151 dependent way, makes auditing yet harder, which IMHO is really 2152 dangerous. Note that while removing the #define, i already found 2153 one bug caused by this excessive complication - in the function 2154 re_putc() in refresh.c. If WIDECHAR was defined, it printed an 2155 Int = wint_t value with %c. Fortunately, that bug only affects 2156 debugging, not production. The fix is contained in the patch. 2157 2158 With WIDECHAR, this doesn't change anything. For the case 2159 without WIDECHAR, i checked that none of the places wants to 2160 store values that might not fit in wint_t. 2161 2162 This only changes internal interfaces; public ones remain 2163 unchanged. 2164 21652016-02-14 15:47 christos 2166 2167 * chartype.c, chartype.h, read.c: From Ingo Schwartze: 2168 2169 Next step: Remove #ifdef'ing in read_char(), in the same style 2170 as we did for setlocale(3) in el.c. 2171 2172 A few remarks are required to explain the choices made. 2173 2174 * On first sight, handling mbrtowc(3) seems a bit less trivial 2175 than handling setlocale(3) because its prototype uses the data 2176 type mbstate_t from <wchar.h>. However, it turns out that 2177 "histedit.h" already includes <wchar.h> unconditionally (i 2178 don't 2179 like headers including other headers, but that ship has 2180 sailed, 2181 people are by now certainly used to the fact that including 2182 "histedit.h" doesn't require including <wchar.h> before), and 2183 "histedit.h" is of course included all over the place. So 2184 from 2185 that perspective, there is no problem with using mbrtowc(3) 2186 unconditionally ever for !WIDECHAR. 2187 2188 * However, <wchar.h> also defines the mbrtowc(3) prototype, 2189 so we cannot just #define mbrtowc away, or including the 2190 header 2191 will break. It would also be a bad idea to porovide a local 2192 implementation of mbrtowc() and hope that it overrides the one 2193 in libc. Besides, the required prototype is subtly different: 2194 While mbrtowc(3) takes "wchar_t *" as its first argument, we 2195 need a function that takes "Char *". So unfortunately, we 2196 have 2197 to keep a ct_mbrtowc #define, at least until we can maybe get 2198 rid of "Char *" in the more remote future. 2199 2200 * After getting rid of the #else clause in read_char(), we can 2201 pull "return 1;" into the default: clause. After that, we can 2202 get rid of the ugly "goto again_lastbyte;" and just "break;". 2203 As a bonus, that also gets rid of the ugly CONSTCOND. 2204 2205 * While here, delete the unused ct_mbtowc() from chartype.h. 2206 22072016-02-12 18:23 christos 2208 2209 * eln.c: Avoid c99 for now. 2210 22112016-02-12 16:36 christos 2212 2213 * el.h, eln.c, read.c: GC IGNORE_EXTCHARS and simplify code (Ingo 2214 Schwarze) 2215 22162016-02-12 16:11 christos 2217 2218 * read.c: From Ingo Schwarze: 2219 2220 If CHARSET_IS_UTF8 is not set, read_char() is broken in a large 2221 number of ways: 2222 2223 1. The isascii(3) check can yield false positives. If a string 2224 in 2225 an arbitrary encoding contains a byte in the range 0..127, 2226 that does not at all imply that it forms a character all by 2227 itself, and even less that it represents the same character 2228 as in ASCII. Consequently, read_char() may return characters 2229 the user never typed. 2230 Even if the encoding is not state dependent, the assumption 2231 that 2232 bytes in the range 0..127 represent ASCII characters is 2233 broken. 2234 Consider UTF-16, for example. 2235 2236 2. The reverse problem can also occur. In an arbitrary 2237 encoding, 2238 there is no guarantee that a character that can be 2239 represented 2240 by ASCII is represented by a seven-bit byte, and even less by 2241 the same byte as in ASCII. 2242 Even for single-byte encodings, these assumptions are broken. 2243 Consider the ISO 646 national variants, for example. 2244 Consequently, the current code is insufficient to keep ASCII 2245 characters working even for single-byte encodings. 2246 2247 3. The condition "++cbp != 1" can never trigger (because 2248 initially, 2249 cbp is 0, and the code can only go back up via the final 2250 goto, 2251 which has another cbp = 0 right before it) and it has no 2252 effect 2253 (because cbp isn't used afterwards). 2254 2255 4. bytes = ct_mbtowc(cp, cbuf, cbp) is broken. If this returns 2256 -1, 2257 the code assumes that is can just call mbtowc(3) again for 2258 later 2259 input bytes. In some implementations, that may even be 2260 broken 2261 for state-independent encodings, but trying again after 2262 mbtowc(3) 2263 failure certainly produces completely erratic and meaningless 2264 results in state-dependent encodings. 2265 2266 5. The assignment "*cp = (Char)(unsigned char)cbuf[0]" is 2267 completely bogus. Even if the byte cbuf[0] represents a 2268 character all by itself, which it usually will not, whether 2269 or not the cast produces the desired result depends on the 2270 internal representation of wchar_t in the C library, which 2271 the application program can know nothing about. Even for 2272 ASCII 2273 in the C/POSIX locale, an ASCII character other than '\0' == 2274 L'\0' == 0 need not have the same numeric value as a char and 2275 as a wchar_t. 2276 2277 To summarize, this code only works if all of the following 2278 conditions hold: 2279 2280 - The encoding is a single-byte encoding. 2281 - ASCII is a subset of the encoding. 2282 - The implementation of mbtowc(3) in the C library does not 2283 require re-initialization after encoding errors. 2284 - The implementation of wchar_t in the C library uses the 2285 same numerical values as ASCII. 2286 2287 Otherwise, it silently produces wrong results. 2288 2289 The simplest way to fix this is to just use the same code as for 2290 UTF-8 (right above). Of course, that causes functional changes 2291 but that shouldn't matter since current behaviour is undefined. 2292 2293 The patch below provides the following improvements: 2294 2295 - It works for all stateless single-byte encodings, no matter 2296 whether they are somehow related to ASCII, no matter how 2297 mb[r]towc(3) are internally implemented, and no matter how 2298 wchar_t is internally represented. 2299 - Instead of producing unpredictable and definitely wrong 2300 results for non-UTF-8 multibyte characters, it behaves in 2301 a well-defined way: It aborts input processing, sets errno, 2302 and returns failure. 2303 Note that short of providing full support for arbitrary 2304 locales, 2305 it is impossible to do better. We cannot know whether a given 2306 unsupported locale is state-dependent, and for a 2307 state-dependent 2308 locale, it makes no sense to retry parsing after an encoding 2309 error, so the best we can do is abort processing for *any* 2310 unsupported multi-byte character. 2311 - Note that single-byte characters in arbitrary 2312 state-independent 2313 locales still work, even in locales that may potentially also 2314 contain multibyte characters, as long as those don't occur in 2315 input. I'm not sure whether any such locales exist in 2316 practice... 2317 2318 Tested with UTF-8 and C/POSIX on OpenBSD. Also tested that in 2319 the C/POSIX locale, non-ASCII bytes get through unmangled. You 2320 may wish to test with ISO-LATIN on NetBSD if NetBSD supports 2321 that. 2322 2323 ---- Also use a constant for meta to avoid warnings. 2324 23252016-02-11 20:21 christos 2326 2327 * chartype.c, common.c, el.c, emacs.c, keymacro.c, map.c, parse.c, 2328 read.c, refresh.c, search.c, sys.h, terminal.c, tty.c: - Add some 2329 more Char casts - reduce ifdefs by providing empty defs for nls 2330 functions (Ingo Schwarze) 2331 23322016-02-11 20:10 christos 2333 2334 * chartype.h: remove unused wrapper (Ingo Schwarze) 2335 23362016-02-11 17:08 christos 2337 2338 * read.c: Remove utf8_islead() mbrtowc() handles this just fine 2339 (Ingo Schwarze) 2340 23412016-02-08 18:18 christos 2342 2343 * chartype.h, read.c: UTF-8 fixes from Ingo Schwarze: 2344 2345 1. Assume that errno is non-zero when entering read_char() 2346 and that read(2) returns 0 (indicating end of file). 2347 Then, the code will clear errno before returning. 2348 (Obviously, the statement "errno = 0" is almost always 2349 a bug unless there is save_errno = errno right before it 2350 and the previous value is properly restored later, 2351 in all reachable code paths.) 2352 2353 2. When encountering an invalid byte sequence, the code discards 2354 all following bytes until MB_LEN_MAX overflows; consider, for 2355 example, 0xc2 immediately followed by a few valid ASCII 2356 bytes. 2357 Three of those ASCII bytes will be discarded. 2358 2359 3. On a POSIX system, EILSEQ will always be set after reading a 2360 valid (yes, valid, not invalid!) UTF-8 character. The reason 2361 is that mbtowc(3) will first be called with a length limit 2362 (third argument) of 1, which will fail, return -1, and - on 2363 a POSIX system - set errno to EILSEQ. 2364 This third bug is mitigated a bit because i couldn't find any 2365 system that actually conforms to POSIX in this respect: None 2366 of OpenBSD, NetBSD, FreeBSD, Solaris 11, and glibc set errno 2367 when an incomplete character is passed to mbtowc(3), even 2368 though 2369 that is required by POSIX. 2370 Anyway, that mbtowc(3) bug will be fixed at least in OpenBSD 2371 after release unlock, so it would be good to fix this bug in 2372 libedit before fixing the bug in mbtowc(3). 2373 2374 How can these three bugs be fixed? 2375 2376 1. As far as i understand it, the intention of the bogus errno = 2377 0 2378 is to undo the effects of failing system calls in el_wset(), 2379 sig_set(), and read__fixio() if the subsequent read(2) 2380 indicates 2381 end of file. So, restoring errno has to be moved right after 2382 read__fixio(). Of course, neither 0 nor e is the right value 2383 to restore: 0 is wrong if errno happened to be set on entry, 2384 e 2385 would be wrong because if one read(2) fails but a second 2386 attempt 2387 succeeds after read__fixio(), errno should not be touched. 2388 So, 2389 the errno to be restored in this case has to be saved before 2390 calling read(2) for the first time. 2391 2392 2. Solving the second issue requires distinguishing invalid and 2393 incomplete characters, but that is impossible with the 2394 function 2395 mbtowc(3) because it returns -1 in both cases and sets errno 2396 to EILSEQ in both cases (once properly implemented). 2397 2398 It is vital that each input character is processed right 2399 away. 2400 It is not acceptable to wait for the next input character 2401 before 2402 processing the previous one because this is an interactive 2403 library, not a batch system. Consequently, the only 2404 situation 2405 where it is acceptable to wait for the next byte without 2406 first 2407 processing the previous one(s) is when the previous one(s) 2408 form 2409 an incomplete sequence that can be continued to form a valid 2410 character. 2411 2412 Consequently, short of reimplementing a full UTF-8 state 2413 machine 2414 by hand, the only correct way forward is to use mbrtowc(3). 2415 Even then, care is needed to always have the state object 2416 properly initialized before using it, and to not discard a 2417 valid 2418 ASCII or UTF-8 lead byte if it happens to follow an invalid 2419 sequence. 2420 2421 3. Fortunately, solution 2. also solves issue 3. as a side 2422 effect, 2423 by no longer using mbtowc(3) in the first place. 2424 24252016-01-30 16:05 christos 2426 2427 * hist.h: Whitespace fix (Ingo Schwarze) 2428 24292016-01-30 05:02 christos 2430 2431 * search.c, tokenizer.c: Fix misplaced parentheses (Ingo Schwarze) 2432 24332016-01-29 20:59 christos 2434 2435 * keymacro.h: One macro is enough (Ingo Schwarze) 2436 24372015-12-08 17:53 gson 2438 2439 * tty.c: unbreak the build 2440 24412015-12-08 13:57 christos 2442 2443 * tty.c: If we did not setup the tty, don't reset it. 2444 24452015-12-08 13:56 christos 2446 2447 * el.c: Only reset the terminal if we have a tty (Boris Ranto) 2448 24492015-11-03 22:36 christos 2450 2451 * editline.3: Fix descriptions of el_set functions. Americanise 2452 initialise :-) 2453 24542015-10-21 23:45 christos 2455 2456 * vi.c: Use the full buffer for the conversion; ideally we should 2457 be dynamically allocating this. From Jilles Tjoelker 2458 24592015-10-19 02:36 christos 2460 2461 * vi.c: make sure we have space for NUL and NUL terminate buffer 2462 array (Jilles Tjoelker) 2463 24642015-06-02 17:36 christos 2465 2466 * readline/readline.h: remove duplicate declaration 2467 24682015-06-02 17:35 christos 2469 2470 * readline.c, readline/readline.h: Adjust API to a more modern 2471 readline (Ryo Onodera) 2472 24732015-05-26 21:59 christos 2474 2475 * readline.c, readline/readline.h: - fix types of 2476 rl_completion_entry_function and rl_add_defun - call update pos 2477 before completion to refresh the screen From Thomas Eriksson 2478 24792015-05-18 17:07 christos 2480 2481 * eln.c: make el_gets() return the number of characters read in 2482 wide mode (not the number of wide characters) From khorben@ by 2483 FreeBSD: 2484 https://svnweb.freebsd.org/ports/head/devel/libedit/files/patch-src_eln.c?\ 2485 revision=382458&view=markup XXX: Pullup-7 2486 24872015-05-17 15:14 christos 2488 2489 * chartype.h: add FreeBSD 2490 24912015-05-14 12:44 christos 2492 2493 * chartype.h, map.c, tty.c: fix warnings on ubuntu 32 bit (Miki 2494 Rozloznik) 2495 24962015-05-13 15:33 martin 2497 2498 * Makefile, chartype.h, editline.3, editrc.5, eln.c, 2499 filecomplete.c, readline.c: Sync lib/libedit with head, requested 2500 by christos in #753: 2501 2502 lib/libedit/Makefile 1.53 2503 lib/libedit/chartype.h 1.13 2504 lib/libedit/editline.3 1.83-1.84 2505 lib/libedit/editrc.5 1.28-1.29 2506 lib/libedit/eln.c 1.18 2507 lib/libedit/filecomplete.c 1.33-1.34 2508 lib/libedit/readline.c 1.112-1.115 2509 2510 Man page improvements, fix overlapping strcpy, improve readline 2511 compatibility, clang build fix. 2512 25132015-04-14 07:30 snj 2514 2515 * chartype.c, chartype.h: Pull up following revision(s) (requested 2516 by christos in ticket #679): lib/libedit/chartype.c: 2517 revisions 1.11, 1.12 lib/libedit/chartype.h: revisions 1.12, 2518 1.13 PR/49683: Amir Plivatsky: Off-by-one comparison in 2519 ct_decode_string() leading to out of bounds referrence. -- split 2520 the allocation functions, their mixed usage was too confusing. 2521 25222015-04-01 17:23 christos 2523 2524 * readline.c: Fix overlapping strcpy (Gerry Swislow) 2525 25262015-03-24 22:29 christos 2527 2528 * readline.c: set some readline compatibility default key settings. 2529 https://bugzilla.redhat.com/attachment.cgi?id=1001895 2530 25312015-03-24 22:26 christos 2532 2533 * eln.c: save and restore IGNORE_EXTCHARS like we do in the getc 2534 case. From: https://bugzilla.redhat.com/attachment.cgi?id=1001894 2535 25362015-02-22 03:16 christos 2537 2538 * chartype.c, chartype.h: split the allocation functions, their 2539 mixed usage was too confusing. 2540 25412015-02-22 01:46 christos 2542 2543 * chartype.c, chartype.h: PR/49683: Amir Plivatsky: Off-by-one 2544 comparison in ct_decode_string() leading to out of bounds 2545 referrence. XXX: pullup-7 2546 25472015-02-17 23:49 christos 2548 2549 * chartype.h: OpenBSD is like us. 2550 25512015-01-29 21:30 joerg 2552 2553 * Makefile: Disable -Wcast-qual for clang for now. 2554 25552014-12-25 14:39 wiz 2556 2557 * editline.3, editrc.5: Bump date for previous. 2558 25592014-12-25 14:39 wiz 2560 2561 * editline.3, editrc.5: From Ingo Schwarze, based on changes from 2562 Kaspars Bankovskis: * Document error handling of el_init(), 2563 el_set(), el_source(), and history_init(). * Fix a typo an 2564 improve punctuation below H_SETUNIQUE. * The ellipsis already 2565 implies "optional", no need for []. * Sort options in 2566 editrc(5). * Prevent e.g. rom being misconstrued as the end of 2567 a sentence. * Drop a useless duplicate .Ar macro. * Put 2568 telltc in its proper place in the alphabetical order. * A few 2569 typos in vi editor command names. * Some missing vi editor 2570 command names. * Some missing author macros. 2571 25722014-10-18 17:07 riz 2573 2574 * filecomplete.c: callers's -> caller's 2575 25762014-10-18 10:33 snj 2577 2578 * filecomplete.c, readline.c: src is too big these days to tolerate 2579 superfluous apostrophes. It's "its", people! 2580 25812014-08-20 02:02 tls 2582 2583 * Makefile, chared.c, chared.h, editline.3, el.c, eln.c, 2584 filecomplete.c, hist.h, histedit.h, history.c, map.c, map.h, 2585 parse.c, read.c, readline.c, tty.c, tty.h, vi.c, TEST/tc1.c, 2586 TEST/wtc1.c: Rebase to HEAD as of a few days ago. 2587 25882014-08-15 15:32 christos 2589 2590 * readline.c: Fix typo in comment (Tobias Stoeckmann) 2591 25922014-08-10 08:51 tls 2593 2594 * Makefile, chared.c, chared.h, editline.3, el.c, eln.c, 2595 filecomplete.c, hist.h, histedit.h, history.c, map.c, map.h, 2596 parse.c, read.c, readline.c, tty.c, tty.h, vi.c, TEST/tc1.c, 2597 TEST/wtc1.c: Rebase. 2598 25992014-07-06 20:15 christos 2600 2601 * map.c, map.h, parse.c, read.c: Bounds search for reallocated 2602 index, from OpenBSD via Andreas Fett 2603 26042014-07-06 20:09 christos 2605 2606 * readline.c: PR/48957: Federico G. Schwindt: Restore commented out 2607 code that broke rl_callback_handler. 2608 26092014-06-18 22:12 christos 2610 2611 * TEST/: tc1.c, wtc1.c: cast gotsig because it is long on some 2612 systems. 2613 26142014-06-18 20:52 christos 2615 2616 * tty.c: Add stdlib.h for abort() (Jess Thrysoee) 2617 26182014-06-18 20:12 christos 2619 2620 * chared.c, chared.h, el.c, eln.c, histedit.h, vi.c: Don't depend 2621 on weak aliases to define the vi "alias" expansion function, 2622 provide an API instead to set it. 2623 26242014-06-18 15:03 christos 2625 2626 * vi.c: accomodate FreeBSD's flavor of weak references. 2627 26282014-06-14 22:49 mrg 2629 2630 * Makefile: remove remaining makefile support for GCC < 45 that i 2631 found. 2632 26332014-06-06 00:07 christos 2634 2635 * filecomplete.c: PR/48876: Dmitriy Grigoryev: Core dump in 2636 readline lib on attempted expansion Make sure we have 2 matches 2637 before calling strcmp(). 2638 26392014-05-22 13:36 yamt 2640 2641 * chared.c, editline.3, el.c, eln.c, hist.h, histedit.h, history.c, 2642 read.c, readline.c, shlib_version, readline/readline.h: sync with 2643 head. 2644 2645 for a reference, the tree before this commit was tagged as 2646 yamt-pagecache-tag8. 2647 2648 this commit was splitted into small chunks to avoid a limitation 2649 of cvs. ("Protocol error: too many arguments") 2650 26512014-05-20 17:05 christos 2652 2653 * eln.c: Always NULL terminate the argv[] array. From OpenBSD. 2654 26552014-05-19 23:01 christos 2656 2657 * tty.c: PR/48821: If called from tty_stty(), recalculate flags. 2658 26592014-05-19 21:54 christos 2660 2661 * tty.c, tty.h: more tty modes refactoring, no functional change 2662 intended. 2663 26642014-05-19 19:14 christos 2665 2666 * tty.c: Factor out some common code (more to be done) from 2667 PR/48821 2668 26692014-05-11 11:01 wiz 2670 2671 * editline.3: Add An to authors. Wording. 2672 26732014-05-11 03:05 christos 2674 2675 * editline.3, hist.h, histedit.h, history.c: Add a history function 2676 that takes a FILE pointer; needed for Capsicum. From Eitan Adler 2677 26782014-02-26 14:50 christos 2679 2680 * eln.c: Add missing EL_REFRESH 2681 26822014-01-21 14:51 christos 2683 2684 * readline.c: ... if called prior to using_history(). This needed 2685 to be worked around in PHP: 2686 http://git.php.net/?p=php-src.git;a=commitdiff;h=31d67bd3 2687 2688 Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1055409 2689 26902013-08-28 10:05 christos 2691 2692 * readline.c: get rid of PATH_MAX. 2693 26942013-07-13 00:39 christos 2695 2696 * chared.c: cast to avoid warning. 2697 26982013-07-12 19:48 christos 2699 2700 * chared.c, editline.3, histedit.h: Add a function to move the 2701 cursor. 2702 27032013-06-23 08:21 tls 2704 2705 * read.c, readline.c, readline/readline.h: resync from head 2706 27072013-05-28 02:10 christos 2708 2709 * readline.c, readline/readline.h: expose rl_catch_signals and 2710 explain what we are doing. 2711 27122013-05-28 01:55 christos 2713 2714 * read.c: Test early for EOF to avoid infinite loop in the wide 2715 char case. From Linas Vepstas: linasvepstas at gmail dot com 2716 27172013-04-02 08:38 agc 2718 2719 * Version.map: add symbol versioning info for: 2720 2721 libcrypt 2722 libcurses 2723 libedit 2724 libmenu 2725 libossaudio 2726 libposix 2727 libskey 2728 27292013-02-25 01:27 tls 2730 2731 * editline.3, editrc.5, el.c, histedit.h, map.c, readline.c, 2732 shlib_version: resync with head 2733 27342013-01-23 01:05 yamt 2735 2736 * editline.3, editrc.5, map.c, readline.c: sync with head 2737 27382013-01-22 21:23 christos 2739 2740 * editline.3, el.c, histedit.h, shlib_version: provide an 2741 el_init_fd function. 2742 27432013-01-13 16:46 christos 2744 2745 * readline.c: explicitly pass (void *)0 instead of NULL. 2746 27472013-01-10 17:03 wiz 2748 2749 * editrc.5: Add FILES section. From jmc@OpenBSD. 2750 27512013-01-10 17:03 wiz 2752 2753 * editline.3: In 2000, .editrc reading from $PWD was removed. 2754 Update the man page. From LEVAI Daniel via jmc@OpenBSD. 2755 27562013-01-01 16:34 christos 2757 2758 * map.c: remove dead assignment (Christoph Mallon) 2759 27602013-01-01 16:33 christos 2761 2762 * map.c: Fix pasto that affected bind -k (Christoph Mallon) 2763 27642012-11-20 04:00 tls 2765 2766 * readline.c: Resync to 2012-11-19 00:00:00 UTC 2767 27682012-10-30 19:59 yamt 2769 2770 * Makefile, chared.c, editline.3, editrc.5, el.c, histedit.h, 2771 read.c, readline.c, terminal.c: sync with head 2772 27732012-10-13 01:35 christos 2774 2775 * readline.c: Add trailing NULL's to the varargs functions as 2776 required. (John Spencer) 2777 27782012-09-11 22:29 christos 2779 2780 * editline.3: PR/46945: Steffen Nurpmeso; el_getc() doesn't 2781 document it's setting errno 2782 27832012-09-11 14:31 christos 2784 2785 * read.c: return !OKCMD on error. 2786 27872012-09-11 13:58 christos 2788 2789 * el.c: PR/46942: Steffen Nurpmeso: editline(3): el_get(): fix 2790 UNBUFFERED return 2791 27922012-09-11 13:57 christos 2793 2794 * editline.3: PR/46941: Steffen Nurpmeso: document EL_BUFFERED 2795 27962012-09-10 22:53 christos 2797 2798 * read.c: PR/46935: Steffen Nurpmeso: editline(3) (libedit): faulty 2799 errno handling, faulty reuse of val in wrong context 2800 28012012-08-10 14:20 joerg 2802 2803 * Makefile: Don't depend on HAVE_GCC being always defined. 2804 28052012-07-18 19:12 christos 2806 2807 * chared.c: From Kamil Dudka: fix crash of el_insertstr() on 2808 incomplete multi-byte 2809 28102012-07-12 20:46 christos 2811 2812 * readline.c: PR/46678: Ian Wienand: Add stub implementation for 2813 rl_free_line_state() 2814 28152012-06-05 22:22 bouyer 2816 2817 * readline.c: Pull up following revision(s) (requested by christos 2818 in ticket #309): lib/libedit/readline.c: revision 1.104 don't 2819 crash if add_history is called from an empty line. Called from 2820 nslookup in new bind. XXX: pullup to 6 2821 28222012-06-05 02:30 christos 2823 2824 * readline.c: don't crash if add_history is called from an empty 2825 line. Called from nslookup in new bind. XXX: pullup to 6 2826 28272012-06-02 16:19 njoly 2828 2829 * editrc.5: Switch from Op to Oo/Oc for nested block. 2830 28312012-05-31 15:16 christos 2832 2833 * histedit.h: remove stdint.h; it is not used. 2834 28352012-05-30 20:21 christos 2836 2837 * terminal.c: don't include both term.h and termcap.h 2838 28392012-05-23 12:07 yamt 2840 2841 * readline.c, tty.c, tty.h, readline/readline.h: sync with head. 2842 28432012-05-15 21:07 christos 2844 2845 * readline.c: define the new variable 2846 28472012-05-15 19:30 christos 2848 2849 * readline.c, readline/readline.h: Add 2850 rl_completion_word_break_hook from: 2851 http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/\ 2852 5ec6a45fa762b8cbd0305ca06acb8780335a486a 2853 28542012-05-15 17:59 christos 2855 2856 * tty.c, tty.h: save and restore the tty settings on entry and exit 2857 respectively. cleanup debugging printfs. 2858 28592012-04-17 02:05 yamt 2860 2861 * Makefile, chartype.h, common.c, el.c, eln.c, history.c, makelist, 2862 map.c, readline.c, terminal.c, terminal.h, vi.c, TEST/wtc1.c: 2863 sync with head 2864 28652012-03-24 21:09 christos 2866 2867 * terminal.c, terminal.h: From: Jilles Tjoelker: Add a mapping for 2868 the cursor delete key 2869 28702012-03-24 21:08 christos 2871 2872 * common.c: From Jilles Tjoelker: Do not move the cursor for 2873 ed-delete-next-char in emacs mode. This makes 2874 ed-delete-next-char suitable for mapping to the <Delete> key. 2875 Behaviour in vi mode is unchanged (for 'x'). 2876 28772012-03-21 06:37 matt 2878 2879 * Makefile: These directories default to WARNS?=5 2880 28812012-03-21 06:34 matt 2882 2883 * makelist: Use C89 functions definitions. 2884 28852012-03-21 06:33 matt 2886 2887 * readline.c: Use C89 functions definitions. Remove use of __P 2888 28892012-03-11 22:15 christos 2890 2891 * eln.c: include the NULL in the argv conversion 2892 28932012-03-11 22:14 christos 2894 2895 * el.c: use arraycount 2896 28972012-01-16 15:57 christos 2898 2899 * vi.c: PR/45843: Henning Petersen: Fix resource leak on error. 2900 29012011-11-18 21:39 christos 2902 2903 * history.c, map.c: Add coverity annotations about unreachable code 2904 (Kamil Dudka) 2905 29062011-11-18 21:38 christos 2907 2908 * readline.c: Add missing * 2909 29102011-11-18 21:32 christos 2911 2912 * terminal.c: Initialize termbuf (Kamil Dudka) 2913 29142011-11-18 21:30 christos 2915 2916 * TEST/wtc1.c: Initialize res (Kamil Dudka) 2917 29182011-11-18 21:25 christos 2919 2920 * terminal.c: check for negative return of ct_visual_char (Kamil 2921 Dudka) 2922 29232011-11-18 21:24 christos 2924 2925 * vi.c: Off by one in allocation could cause buffer overflow (Kamil 2926 Dudka) 2927 29282011-11-18 21:22 christos 2929 2930 * el.c: remove unrecheable code (Kamil Dudka) 2931 29322011-11-16 02:45 christos 2933 2934 * chartype.h: easier with an int for now. 2935 29362011-11-16 00:54 christos 2937 2938 * chartype.h: Since Width() is used only for display purposes we 2939 don't want to pass -1 for unprintable characters. 2940 29412011-10-23 19:37 christos 2942 2943 * chared.c: Fixed misplaced parenthesis (Nirbhay Choubey) 2944 29452011-10-04 17:27 christos 2946 2947 * search.c, terminal.c, tty.c, vi.c: 2948 fixed warnings where wint_t is unsigned. 2949 29502011-10-03 16:09 christos 2951 2952 * terminal.c: fix broken change (parenthesis in the wrong place). 2953 From Nirbhay Choubey 2954 29552011-09-28 16:08 christos 2956 2957 * sys.h: include <wchar.h> if we don't have wcsdup() 2958 29592011-09-16 18:13 plunky 2960 2961 * filecomplete.c: NULL does not need a cast, here 2962 29632011-08-16 18:25 christos 2964 2965 * Makefile, chared.c, chartype.c, eln.c, filecomplete.c, 2966 keymacro.c, map.c, parse.c, read.c, readline.c, search.c, 2967 terminal.c, tokenizer.c, tty.c, tty.h, vi.c: re-enable 2968 -Wconversion 2969 29702011-08-04 16:33 christos 2971 2972 * TEST/wtc1.c: need err.h now 2973 29742011-08-02 19:22 joerg 2975 2976 * Makefile: Only use -Wconversion if GCC is actually the active 2977 compiler. 2978 29792011-07-30 12:07 tron 2980 2981 * Makefile: Don't use "-Wconversion" with GCC 4.5 which will 2982 complain about all the expressions where signed variables are 2983 converted to unsigned in an expression e.g. "size_t foo = 2984 sizeof(something) * int_var;". 2985 29862011-07-30 01:44 christos 2987 2988 * Makefile, chared.c, chartype.c, chartype.h, el.h, filecomplete.c, 2989 history.c, keymacro.c, read.c, readline.c, refresh.c, search.c, 2990 terminal.c, terminal.h, vi.c: pass -Wconversion 2991 29922011-07-29 22:58 christos 2993 2994 * common.c, filecomplete.c, history.c, readline.c, vi.c: - fix 2995 unused params - unconditionalize vis.h 2996 29972011-07-29 22:57 christos 2998 2999 * config.h: better autoconf results 3000 30012011-07-29 22:56 christos 3002 3003 * Makefile: add -Wunused-parameter Is that the right way? Perhaps 3004 WARNS=5? 3005 30062011-07-29 17:20 christos 3007 3008 * chared.c, common.c, sys.h, terminal.c, tty.c: kill ifdef notdef 3009 30102011-07-29 17:16 christos 3011 3012 * chared.c, chartype.c, common.c, el.c, emacs.c, filecomplete.c, 3013 hist.c, history.c, keymacro.c, map.c, parse.c, prompt.c, read.c, 3014 readline.c, search.c, terminal.c, tokenizer.c, tty.c, vi.c: KNF 3015 return (\1); -> return \1; 3016 30172011-07-28 22:50 christos 3018 3019 * chared.c, chartype.c, el.c, eln.c, filecomplete.c, hist.c, 3020 hist.h, histedit.h, history.c, keymacro.c, map.c, read.c, 3021 readline.c, search.c, sig.c, sys.h, terminal.c, tokenizer.c, 3022 vi.c: kill ptr_t and ioctl_t, add * sizeof(*foo) to all 3023 allocations. 3024 30252011-07-28 19:33 christos 3026 3027 * filecomplete.c: fix unused variable warnings on systems without 3028 _r functions 3029 30302011-07-28 19:33 christos 3031 3032 * readline.c: handle systems without getpwent_r 3033 30342011-07-28 07:18 joerg 3035 3036 * config.h: Sync compat defines to unbreak build. 3037 3038 XXX Do a proper config.h update from configure 3039 30402011-07-28 05:52 christos 3041 3042 * keymacro.c, terminal.c: whitespace 3043 30442011-07-28 05:48 christos 3045 3046 * keymacro.c: whitespace 3047 30482011-07-28 05:44 christos 3049 3050 * keymacro.h: whitespace and comments 3051 30522011-07-28 03:56 christos 3053 3054 * Makefile, el.c, el.h, key.c, key.h, keymacro.c, keymacro.h, 3055 map.c, read.c, terminal.c, terminal.h, tty.c: Rename key to 3056 keymacro to avoid conflicts with term.h. The renaming of term to 3057 terminal was again to avoid conflicts with term.h. term.h is a 3058 moving namespace violation. 3059 30602011-07-28 03:08 christos 3061 3062 * TEST/wtc1.c: - check and don't cast malloc return - more wide 3063 function use 3064 30652011-07-28 03:05 christos 3066 3067 * Makefile, chared.c, common.c, el.h, eln.c, emacs.c, map.c, 3068 parse.c, prompt.c, refresh.c, term.c, term.h, terminal.c, 3069 terminal.h: term -> terminal XXX: need to rename key_ too. 3070 30712011-07-28 03:05 christos 3072 3073 * config.h: regen 3074 30752011-07-28 03:04 christos 3076 3077 * el.c: avoid shadowed variable 3078 30792011-07-28 02:54 christos 3080 3081 * readline.c: use vis.h from . 3082 30832011-07-28 02:50 christos 3084 3085 * filecomplete.c: eliminate alloca for portability portable 3086 getpw{nam,uid} 3087 30882011-07-28 02:49 christos 3089 3090 * el.c: term -> terminal eliminate MAXPATHLEN 3091 30922011-07-28 02:48 christos 3093 3094 * chartype.c: - fix memory allocation botch in wide strings - check 3095 mbstowcs return code 3096 30972011-07-28 02:45 christos 3098 3099 * sys.h: more portability defines 3100 31012011-07-28 02:45 christos 3102 3103 * vi.c, tty.c, sig.c, search.c: term -> terminal 3104 31052011-07-28 02:44 christos 3106 3107 * read.c: term -> terminal fix wide function confusion 3108 31092011-07-28 02:43 christos 3110 3111 * makelist: include config.h for all c files. 3112 31132011-07-28 02:43 christos 3114 3115 * history.c: include vis.h from dot. 3116 31172011-07-28 02:43 christos 3118 3119 * hist.c: fix confusion with wide functions. 3120 31212011-07-27 15:18 christos 3122 3123 * history.c: fix narrow compilation 3124 31252011-07-27 04:23 christos 3126 3127 * history.c: - don't leave cursor dangling on memory failure or 3128 after clearing the list - compute the string length to be 3129 strvis'ed after the string is encoded 3130 31312011-07-27 04:18 christos 3132 3133 * chartype.c: fix buffer growing code. 3134 31352011-07-27 04:18 christos 3136 3137 * TEST/wtc1.c: add history testing code. 3138 31392011-07-26 23:03 christos 3140 3141 * el.c: don't stop reading after empty lines from: Nirbhay Choubey 3142 31432011-07-10 01:54 christos 3144 3145 * read.c: make obvious what we are trying to do... 3146 31472011-07-09 18:04 tron 3148 3149 * read.c: Try to fix build of port where "char" is unsigned. 3150 31512011-07-08 17:54 christos 3152 3153 * read.c: Support other non-latin1 single byte character sets. 3154 From: Alexander Barkov and Nirbhay Choubey at oracle dot com 3155 31562011-06-23 16:18 cherry 3157 3158 * Makefile, eln.c: Catchup with rmind-uvmplock merge. 3159 31602011-06-21 04:32 mrg 3161 3162 * Makefile: add some XXX'd -Wno-foo if HAVE_GCC >= 45. 3163 3164 XXX: someone should look at these. 3165 31662011-06-20 11:11 mrg 3167 3168 * eln.c: various build fixes for gcc 4.5. from chuq. XXX i'm not 3169 sure all of these work properly wtf pointer aliasing, but there 3170 are no casts at least... 3171 3172 the lib/libpuffs/puffs_priv.h is definately a real bug fix. 3173 3174 from chuq. 3175 31762011-04-26 00:47 wiz 3177 3178 * editrc.5: Markup consistency, from YOMURA Masanori. Add serial 3179 comma. 3180 31812011-03-20 13:36 bouyer 3182 3183 * el.c: Fix use-after-free. Discovered by running tests with 3184 MALLOC_OPTIONS=J (should this be the default for tests ?), 3185 pointed out by njoly@ 3186 31872011-03-05 16:09 bouyer 3188 3189 * editline.3, read.c, vi.c: Sync with HEAD 3190 31912011-02-27 02:51 christos 3192 3193 * editline.3: Fix argument for EL_EDITOR from Jess Thrysoee 3194 31952011-02-22 06:45 joerg 3196 3197 * vi.c: Introduce __weakref_visible to handle the different 3198 required visibility for weak references. GCC 4.2+ and Clang 3199 require static, older GCC wants extern. Change __weak_reference 3200 to include sym. This requires changes the existing users to not 3201 reuse the name of the symbol, but avoids further differences 3202 between GCC 4.1 and GCC 4.2+/clang. 3203 32042011-02-18 21:53 christos 3205 3206 * read.c: PR/44599: Steven Vernon: libedit acts as if no data read 3207 if editmode is turned off because nread is uninitialized in the 3208 edit disabled case. 3209 32102011-02-17 17:44 joerg 3211 3212 * vi.c: Deal with changes in the weak_reference semantic in GCC 4.2 3213 and later. 3214 32152011-02-08 17:19 bouyer 3216 3217 * el.c, el.h, tty.c: Sync with HEAD 3218 32192011-01-28 04:41 christos 3220 3221 * tty.c: fix pasto 3222 32232011-01-28 00:11 christos 3224 3225 * el.c, el.h, tty.c: don't turn on editing if stdout is not a tty. 3226 32272011-01-16 04:05 christos 3228 3229 * history.c: off by one in fetching history data. From: Gerry 3230 Swislow 3231 32322010-12-16 18:42 wiz 3233 3234 * chartype.h, editline.3: Observe the following spelling: - wide 3235 character (noun) - wide-character (adjective) 3236 3237 Inspired by jmc@OpenBSD. 3238 32392010-12-06 01:05 dholland 3240 3241 * filecomplete.c: Improve previous to avoid changing the interface 3242 of an externally exposed function. (But note that this function 3243 is neither documented nor declared in any installed header file, 3244 and it probably should not be externally exposed.) Related to PR 3245 44183, closes PR 44186. 3246 32472010-12-02 05:42 dholland 3248 3249 * filecomplete.c: add const, from PR 44183. 3250 32512010-12-02 05:35 dholland 3252 3253 * filecomplete.c: Fix up bodgy code for printing completion 3254 matches; it used to sometimes skip entries, print (null), run off 3255 the end of the array, or occasionally receive SIGSEGV, and now 3256 will, hopefully at least, do none of that. 3257 3258 Based in part on the patch in PR 44183 from Sergio Acereda; I 3259 also did some tidyup and fixed it to print top-to-bottom first 3260 like ls(1). 3261 32622010-11-15 22:24 christos 3263 3264 * filecomplete.c: don't increment i twice in the loop. From Michael 3265 Byrnes 3266 32672010-11-04 14:53 christos 3268 3269 * eln.c: PR/43998, PR/44021: In narrow history emulation, don't 3270 treat UTF-8 character sets specially as far as history goes since 3271 we always need to do the conversion from narrow [history] to wide 3272 [editline]. 3273 32742010-10-24 01:27 christos 3275 3276 * vi.c: fix fd leak found by Igor Zinovik 3277 32782010-09-16 22:08 christos 3279 3280 * readline.c, TEST/rl1.c, readline/readline.h: unbreak readline 3281 history. 3282 32832010-08-28 17:44 christos 3284 3285 * chared.c, chared.h, el.c, eln.c, histedit.h, readline.c: setup a 3286 callback to be invoked on resize buffers so that readline can 3287 reset rl_line_buffer which unfortunately some applications use it 3288 directly. 3289 32902010-08-04 22:29 christos 3291 3292 * readline.c, readline/readline.h: provide rl_on_newline 3293 32942010-07-21 20:18 christos 3295 3296 * read.c: refresh only on SIGCONT not SIGWINCH from Edward 3297 Sheldrake 3298 32992010-07-19 19:18 christos 3300 3301 * read.c: retry the read after sigwinch too, from Edward Sheldrake 3302 33032010-06-01 20:20 christos 3304 3305 * filecomplete.c: tidy up memory allocation and don't unnecessarily 3306 print "./" before names. 3307 33082010-04-21 07:28 matt 3309 3310 * common.c: sync to netbsd-5 3311 33122010-04-20 04:01 christos 3313 3314 * chartype.h: Use the same hack for Solaris and MacOS/X. This is 3315 not right, we only really support UTF-8, but it will get us going 3316 until this is fixed properly. From Jess Thrysoee 3317 33182010-04-18 23:17 christos 3319 3320 * TEST/: tc1.c, wtc1.c: \033 is more portable than \e still. 3321 33222010-04-18 23:17 christos 3323 3324 * tty.c: ffs needs strings.h 3325 33262010-04-18 23:17 christos 3327 3328 * makelist: shame on solaris that is the last OS not supporting $() 3329 33302010-04-15 02:57 christos 3331 3332 * chared.h, makelist, readline.c, search.c: From Jess Thrysoee 3333 - Fix wint_t to Int confusion 3334 33352010-04-15 02:56 christos 3336 3337 * el.c: From Jess Thrysoee - use nl_langinfo to test for UTF-8, 3338 because some locales are UTF-8 without reflecting it in 3339 their names. 3340 33412010-04-15 02:55 christos 3342 3343 * chartype.c, chartype.h: From Jess Thrysoee expose 3344 ct_enc_width() 3345 33462010-04-15 02:52 christos 3347 3348 * eln.c: From Jess Thrysoee - NARROW_HISTORY and IGNORE_EXTCHARS 3349 should not take effect if locale is UTF-8 - account for multi 3350 byte char length in 3351 33522010-04-15 02:50 christos 3353 3354 * TEST/tc1.c: From Jess Thrysoee: call setlocale so we can test 3355 UTF-8 3356 33572010-04-15 02:50 christos 3358 3359 * histedit.h: From Jess Thrysoee: add ifndef around def of 3360 _GNU_SOURCE 3361 33622010-03-22 23:59 christos 3363 3364 * read.c: https://bugzilla.redhat.com/show_bug.cgi?id=575383 Handle 3365 EINTR properly. 3366 33672010-02-03 16:34 roy 3368 3369 * Makefile, TEST/Makefile: Userland now builds and uses terminfo 3370 instead of termcap. 3371 3372 OK: core@, jdc@ 3373 33742010-01-20 02:15 christos 3375 3376 * eln.c: PR/42646: Joachim Kuebart: Shell crashes in libedit when 3377 window size changes (SIGWINCH). Return NULL if el_gets() gets 3378 interrupted. 3379 33802010-01-19 23:38 christos 3381 3382 * eln.c: Fix wrapper for EL_EDITOR, from Michael L. Hitch 3383 33842010-01-18 20:17 christos 3385 3386 * filecomplete.c: PR/42637: Joachim Kuebart: Shell tab completion 3387 crashes due to libedit stack smashing 3388 33892010-01-12 20:40 christos 3390 3391 * eln.c: - call the mapping function directly instead of el_wset(). 3392 - save the strings passed to the mapping function so that they 3393 don't get re-used. This leaks. To fix it properly we could 3394 either pass a flag to free particular entries before re-using, 3395 or allocate all of them. Allocating all of them wastes memory, 3396 allocating some of them makes the code more complex. This 3397 fixes compatibility binding (shell tab completion for example) 3398 33992010-01-12 20:37 christos 3400 3401 * chartype.c: - in the argv conversion, handle NULL as NULL - when 3402 printing tab/nl print them, don't handle them specially. 3403 34042010-01-03 20:05 wiz 3405 3406 * editline.3: Bump date for historyw -> history_w. 3407 34082010-01-03 19:27 christos 3409 3410 * chartype.h, editline.3, histedit.h, history.c, readline.c, 3411 tokenizer.c, TEST/Makefile, TEST/wtc1.c: rename historyw -> 3412 history_w for consistency. add wide tst code and make it the 3413 default. 3414 34152009-12-31 19:32 christos 3416 3417 * chartype.c, chartype.h: expose the encode and decode string 3418 functions for the benefit of history and readline. 3419 34202009-12-31 16:58 christos 3421 3422 * Makefile, editline.3, el.c, el.h, eln.c, histedit.h, prompt.c, 3423 read.c: - Document and enable wide character support. - Fix read 3424 function compatibility. 3425 34262009-12-31 00:54 christos 3427 3428 * Makefile, chartype.h, el.c, el.h, eln.c, hist.c, hist.h, 3429 histedit.h, history.c, makelist, readline.c, search.c, 3430 tokenizer.c: Fix wide build, test it, but don't turn it on yet. 3431 34322009-12-30 23:37 christos 3433 3434 * Makefile, chared.c, chared.h, chartype.c, chartype.h, common.c, 3435 el.c, el.h, eln.c, emacs.c, filecomplete.c, filecomplete.h, 3436 hist.c, hist.h, histedit.h, history.c, key.c, key.h, makelist, 3437 map.c, map.h, parse.c, parse.h, prompt.c, prompt.h, read.c, 3438 read.h, readline.c, refresh.c, refresh.h, search.c, search.h, 3439 sys.h, term.c, term.h, tokenizer.c, tty.c, tty.h, vi.c: Wide 3440 character support (UTF-8) from Johny Mattsson; currently 3441 disabled. 3442 34432009-12-28 23:15 christos 3444 3445 * refresh.c: reduce diff with tcsh 3446 34472009-12-28 22:55 christos 3448 3449 * filecomplete.c: improve on the listing display by printing only 3450 one character after the filename not two, and no trailing blanks. 3451 I will revisit this when I write the ls-F code. 3452 34532009-12-28 22:54 christos 3454 3455 * term.c: Reduce diff with tcsh's editor. No functional change 3456 intended. 3457 34582009-12-28 22:52 christos 3459 3460 * refresh.c: Fix bug where tab completion on the second or > line 3461 that caused listing ended up corrupting the display by an extra 3462 space in the beginning. Reported by Mac Chan. 3463 34642009-09-07 23:24 christos 3465 3466 * histedit.h, history.c, readline.c, readline/readline.h: apply 3467 apple patches from: 3468 http://opensource.apple.com/source/libedit/libedit-11/patches/ 3469 34702009-08-31 02:05 christos 3471 3472 * sys.h, term.c, readline/readline.h: delete defined(sun), it could 3473 be invaded in the user namespace. Suggested by mrg@ 3474 34752009-08-30 17:41 christos 3476 3477 * sys.h, term.c, readline/readline.h: use __sun || sun instead of 3478 _SunOS, from Jess Thrysoee 3479 34802009-07-25 23:19 christos 3481 3482 * el.c: Ignore comment lines in .editrc from Jess Thrysoee 3483 34842009-07-22 20:25 christos 3485 3486 * el.c: Only need path if we have issetugid... From Anon Ymous 3487 34882009-07-22 17:58 christos 3489 3490 * tty.c: Don't depend on side effects inside an assert From Michael 3491 Cook mcook at bbn dot com 3492 34932009-07-22 17:57 christos 3494 3495 * readline.c: Fix memory leaks in error paths. From Michael Cook 3496 mcook at bbn dot com 3497 34982009-07-22 17:57 christos 3499 3500 * read.c: Always initialize nread since it is an out param. From 3501 Michael Cook mcook at bbn dot com 3502 35032009-07-22 17:56 christos 3504 3505 * el.c: Move filename to the scope it is being used. From Michael 3506 Cook mcook at bbn dot com 3507 35082009-07-17 14:28 christos 3509 3510 * refresh.c: Simplify the code. No functional change. 3511 35122009-07-17 14:27 christos 3513 3514 * term.c: - off by one in the term.h case. - make code more 3515 similar to tcsh (if we want to handle wide chars, this is 3516 needed; for now it is a no-op) 3517 35182009-07-17 14:26 christos 3519 3520 * prompt.c: handle prompt_esc properly. 3521 35222009-07-17 14:25 christos 3523 3524 * TEST/tc1.c: Use the proper prompt printing function. 3525 35262009-07-09 21:02 christos 3527 3528 * readline/readline.h: add stdio.h since we are using FILE. From 3529 Grant Erickson 3530 35312009-07-05 23:55 perry 3532 3533 * editline.3: note that the return value of el_gets doesn't remain 3534 valid across calls. 3535 35362009-06-09 15:04 christos 3537 3538 * read.c: decrement the number of levels after the loop (Julien 3539 Torres) 3540 35412009-06-08 17:10 christos 3542 3543 * read.c: from Julien Torres, flip the order we pop in the macro 3544 array. 3545 35462009-05-19 23:45 christos 3547 3548 * refresh.c: always scroll when we advance past bottom. From Caleb 3549 Welton cwelton at greenplum dot com 3550 35512009-05-13 21:18 jym 3552 3553 * chared.c, chared.h, common.c, editline.3, editrc.5, el.c, el.h, 3554 emacs.c, filecomplete.c, filecomplete.h, histedit.h, key.c, 3555 key.h, makelist, prompt.c, prompt.h, read.c, readline.c, 3556 refresh.c, search.c, sig.c, sig.h, term.c, term.h, tokenizer.c, 3557 tty.c, vi.c, TEST/tc1.c, readline/readline.h: Sync with HEAD. 3558 3559 Third (and last) commit. See 3560 http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html 3561 35622009-05-12 10:14 wiz 3563 3564 * editline.3: Punctuation nit. 3565 35662009-05-11 20:33 christos 3567 3568 * editline.3, el.c, histedit.h: restore binary compatibility by 3569 providing new prompt functions that take an extra literal 3570 character. 3571 35722009-05-04 00:53 snj 3573 3574 * common.c: Pull up following revision(s) (requested by msaitoh in 3575 ticket #703): lib/libedit/common.c: revision 1.23 fix 3576 mis-evaluating whether a char is digit or not. 3577 35782009-04-30 20:11 bouyer 3579 3580 * common.c: Pull up following revision(s) (requested by msaitoh in 3581 ticket #1307): lib/libedit/common.c: revision 1.23 fix 3582 mis-evaluating whether a char is digit or not. 3583 35842009-04-23 04:03 snj 3585 3586 * term.c: Apply patch (requested by msaitoh in ticket #2007): 3587 Coverity CID 1668: Plug memory leak when malloc() failed. 3588 35892009-04-23 04:00 snj 3590 3591 * common.c: Pull up following revision(s) (requested by msaitoh in 3592 ticket #2006): lib/libedit/common.c: revision 1.23 fix 3593 mis-evaluating whether a char is digit or not. 3594 35952009-04-16 21:39 christos 3596 3597 * prompt.c: PR/41230: -current: sh(1) endlessly looping in 3598 interactive Fix proposed from Matthew Mondor 3599 36002009-04-12 00:17 wiz 3601 3602 * editrc.5: Drop trailing whitespace. 3603 36042009-04-11 22:53 joerg 3605 3606 * editrc.5: Don't use .Xo/.Xc to work around ancient macro argument 3607 limit in groff. 3608 36092009-04-11 22:48 joerg 3610 3611 * editline.3: Don't use .Xo/.Xc to avoid ancient macro argument 3612 limit. 3613 36142009-04-08 23:31 christos 3615 3616 * readline.c: Fix off by one error reported by: Caleb Welton 3617 cwelton at greenplum dot com 3618 36192009-04-01 10:58 wiz 3620 3621 * editline.3: Readability improvement. Whitespace nits. 3622 36232009-03-31 23:33 christos 3624 3625 * term.c: cast to size_t to avoid sign / unsigned comparison 3626 warning. 3627 36282009-03-31 19:53 christos 3629 3630 * readline.c, readline/readline.h: implement 3631 RL_PROMPT_{START,END}_IGNORE 3632 36332009-03-31 19:38 christos 3634 3635 * editline.3, el.c, histedit.h, prompt.c, prompt.h, refresh.c, 3636 term.c, term.h, TEST/tc1.c: Implement literal prompt sequences. 3637 Now someone can implement 3638 RL_PROMPT_START_LITERAL/RL_PROMPT_END_LITERAL :-) 3639 36402009-03-10 23:55 wiz 3641 3642 * editline.3: -1 is not a defined value, it is just a value. On 3643 the other hand, minuses need backslashes, otherwise they become 3644 hyphens. 3645 36462009-03-10 21:46 christos 3647 3648 * editline.3, read.c: make el_gets set the count to -1 on error to 3649 distinguish between EOF and error. 3650 36512009-03-09 20:24 joerg 3652 3653 * editline.3, editrc.5: Fix preamble to match order set out by 3654 mdoc(7). Discussed with wiz. 3655 36562009-02-27 05:18 msaitoh 3657 3658 * common.c: fix mis-evaluating whether a char is digit or not. 3659 36602009-02-22 00:35 christos 3661 3662 * read.c: remove VEOF test. the tty is in cooked mode when we are 3663 not editing and the tty driver does the check for us. 3664 36652009-02-22 00:31 christos 3666 3667 * key.c, key.h, readline.c, vi.c: more size_t stuff. 3668 36692009-02-22 00:31 christos 3670 3671 * read.c: use the VEOF character from the terminal, instead of 3672 hard-coding 4. 3673 36742009-02-21 08:58 wiz 3675 3676 * editline.3: Restore markup changes (probably accidentally) 3677 reverted in previous. 3678 36792009-02-21 01:05 christos 3680 3681 * editline.3, el.c, histedit.h, prompt.c, prompt.h: back out all 3682 prompt changes. they are not needed. 3683 36842009-02-19 21:27 cube 3685 3686 * el.c: Order of evaluation of arguments is undefined, so call 3687 va_arg() in an explicit order. Fixes a segfault with bc reported 3688 by Patrick Welche on current-users. 3689 36902009-02-19 16:20 christos 3691 3692 * read.c, sig.c, sig.h: reset and redraw on sigcont. From Anon 3693 Ymous. 3694 36952009-02-19 10:48 wiz 3696 3697 * editline.3: Fix wordo, use more markup. 3698 36992009-02-19 02:18 christos 3700 3701 * histedit.h: bump version for prompt arg. 3702 37032009-02-19 02:18 christos 3704 3705 * editline.3: document extra argument. 3706 37072009-02-18 16:04 christos 3708 3709 * sig.c: SA_RESTART for all signals but SIGINT. From Anon Ymous. 3710 37112009-02-17 22:34 christos 3712 3713 * el.c, histedit.h, prompt.c, prompt.h: allow for a prompt 3714 argument. 3715 37162009-02-16 01:15 christos 3717 3718 * filecomplete.c, filecomplete.h, key.c, tty.c: fix sign compare 3719 issues. 3720 37212009-02-15 22:55 christos 3722 3723 * chared.c, chared.h, common.c, emacs.c, filecomplete.c, 3724 filecomplete.h, key.c, key.h, read.c, readline.c, refresh.c, 3725 search.c, term.c, tokenizer.c, tty.c, vi.c: pass lint on _LP64. 3726 37272009-02-15 22:25 christos 3728 3729 * sig.c, sig.h: in order for read() to return EINTR we need to use 3730 sigaction, not signal, otherwise SA_RESTART is set. 3731 37322009-02-15 22:24 christos 3733 3734 * el.h, read.c: don't restart on EINTR, instead return NULL 3735 immediately. From Anon Ymous 3736 37372009-02-12 14:39 sketch 3738 3739 * makelist, readline.c, term.c, readline/readline.h: More fixes for 3740 existing portability stuff. 3741 37422009-02-06 21:08 sketch 3743 3744 * sys.h, term.c: SUNOS is spelt __SunOS. Add missing prototypes. 3745 37462009-02-06 20:53 sketch 3747 3748 * tty.c: Needs errno.h 3749 37502009-02-06 15:40 sketch 3751 3752 * history.c: Plug memory leak, from MySQL. 3753 37542009-02-06 14:14 sketch 3755 3756 * vi.c: Portability fix. 3757 37582009-02-06 13:45 sketch 3759 3760 * chared.c: de-__P() 3761 37622009-02-05 20:15 christos 3763 3764 * histedit.h, read.c: match documentation in el_push 3765 37662009-02-05 20:15 christos 3767 3768 * readline.c, readline/readline.h: add rl_set_prompt 3769 37702009-01-26 18:32 apb 3771 3772 * config.h, filecomplete.c: Define HAVE_STRUCT_DIRENT_D_NAMLEN in 3773 config,h, and test it when deciding whether to use 3774 entry->d_namlen or strlen(entry->d_name). Addresses PR 40477 by 3775 Robert Millan. 3776 37772009-01-18 13:17 lukem 3778 3779 * Makefile: WARNS=4 3780 37812009-01-18 13:17 lukem 3782 3783 * el.c, read.c, readline.c: fix -Wsign-compare issues 3784 37852009-01-11 16:00 christos 3786 3787 * filecomplete.c, readline.c: - insert a space after the recognized 3788 string if it was an exact match - initialize properly the string 3789 used for completion. From Alex Bligh alex at alex dot org dot uk 3790 - Make char constants consistent 3791 37922009-01-11 04:07 christos 3793 3794 * shlib_version: bump shared libraries. 3795 37962008-09-30 10:37 aymeric 3797 3798 * common.c: have '$' include the last character in the line when 3799 embedded in a command. This fixes c$, d$, y$, and so on in vi 3800 mode. 3801 38022008-09-24 18:35 wrstuden 3803 3804 * common.c, el.c, read.c, refresh.c, sig.c, term.c, term.h, tty.c: 3805 Merge in changes between wrstuden-revivesa-base-2 and 3806 wrstuden-revivesa-base-3. 3807 38082008-09-18 06:39 wrstuden 3809 3810 * sig.h, tty.c: Sync with wrstuden-revivesa-base-2. 3811 38122008-09-10 17:45 christos 3813 3814 * common.c, el.c, read.c, refresh.c, sig.c, term.c, term.h, tty.c: 3815 Allow a single process to control multiple ttys (for pthreads 3816 using _REENTRANT) using multiple EditLine objects. Mostly from 3817 Preston A. Elder. 3818 38192008-07-30 15:00 christos 3820 3821 * tty.c: handle EINTR in the termios operations, reported by the 3822 GHC folks 3823 38242008-07-12 17:27 christos 3825 3826 * sig.h: Don't bother with SIGSTOP it cannot be caught or ignored. 3827 From Jess Thrysoee 3828 38292008-05-18 14:30 yamt 3830 3831 * editline.3, editrc.5, filecomplete.c, filecomplete.h, read.h, 3832 readline.c, readline/readline.h: sync with head. 3833 38342008-04-30 15:10 martin 3835 3836 * editline.3, editrc.5: Convert TNF licenses to new 2 clause 3837 variant 3838 38392008-04-29 08:53 martin 3840 3841 * filecomplete.c, filecomplete.h, read.h, readline.c, 3842 readline/readline.h: Convert to new 2 clause license 3843 38442008-04-06 01:53 christos 3845 3846 * histedit.h, shlib_version: bump minor. 3847 38482008-04-05 17:53 christos 3849 3850 * editline.3, el.c, histedit.h, readline.c: add EL_REFRESH for the 3851 benefit of readline 3852 38532008-04-04 23:18 christos 3854 3855 * readline.c, readline/readline.h: Add rl_forced_update_display() 3856 from Gerry Swislow 3857 38582007-08-12 09:41 christos 3859 3860 * readline.c, readline/readline.h: patches from Axel Thimm 3861 38622007-06-10 22:20 christos 3863 3864 * histedit.h: Fix tab/space confusion; from Stefan Farfeleder 3865 38662007-05-28 14:06 tls 3867 3868 * Makefile: Add new Makefile knob, USE_FORT, which extends USE_SSP 3869 by turning on the FORTIFY_SOURCE feature of libssp, thus checking 3870 the size of arguments to various string and memory copy and set 3871 functions (as well as a few system calls and other miscellany) 3872 where known at function entry. RedHat has evidently built all 3873 "core system packages" with this option for some time. 3874 3875 This option should be used at the top of Makefiles (or 3876 Makefile.inc where this is used for subdirectories) but after any 3877 setting of LIB. 3878 3879 This is only useful for userland code, and cannot be used in libc 3880 or in any code which includes the libc internals, because it 3881 overrides certain libc functions with macros. Some effort has 3882 been made to make USE_FORT=yes work correctly for a full-system 3883 build by having the bsd.sys.mk logic disable the feature where it 3884 should not be used (libc, libssp iteself, the kernel) but no 3885 attempt has been made to build the entire system with USE_FORT 3886 and doing so will doubtless expose numerous bugs and misfeatures. 3887 3888 Adjust the system build so that all programs and libraries that 3889 are setuid, directly handle network data (including serial comm 3890 data), perform authentication, or appear likely to have (or have 3891 a history of having) data-driven bugs (e.g. file(1)) are built 3892 with USE_FORT=yes by default, with the exception of libc, which 3893 cannot use USE_FORT and thus uses only USE_SSP by default. 3894 Tested on i386 with no ill results; USE_FORT=no per-directory or 3895 in a system build will disable if desired. 3896 38972007-05-27 21:45 christos 3898 3899 * readline.c, readline/readline.h: Add rl_completion_matches, fix 3900 remove_history 3901 39022007-03-01 22:41 christos 3903 3904 * read.c: Fix bug with multiple pending el_pushes. Reported by 3905 Julien Torres. 3906 39072007-01-12 17:31 christos 3908 3909 * editline.3: PR/35411: Matthew Wala: inconsistency in editline(3): 3910 rename "num" to the appropriate parameter names. 3911 39122006-12-18 01:03 wiz 3913 3914 * editline.3: Fix xref section. Whitespace cleanups.. 3915 39162006-12-15 23:13 christos 3917 3918 * editline.3, el.c, el.h, histedit.h: add EL_GETFP, and EL_SETFP. 3919 39202006-11-25 18:54 freza 3921 3922 * el.c: s/el->errfile/el->el_errfile/g in debug code, fixes 3923 MKDEBUGLIB build. 3924 39252006-11-24 01:03 christos 3926 3927 * histedit.h: bump minor. 3928 39292006-11-24 01:01 christos 3930 3931 * editline.3, el.c, histedit.h, readline.c, shlib_version, term.c, 3932 term.h, readline/readline.h: - Add more readline functions, 3933 enough for gdb-6.5 - Make el_get varyadic, and implement 3934 EL_GETTC. - XXX: the EL_SETTC api will change in the future. 3935 39362006-11-09 17:58 christos 3937 3938 * filecomplete.c: don't use alloca with ssp. 3939 39402006-10-22 09:48 mrg 3941 3942 * vi.c: __weakref__ attribute can not be applied to anything when 3943 inside function scope, so, move the extern of get_alias_text 3944 outside vi_alias(). 3945 3946 fixes build problems with GCC 4.1-20061021. 3947 39482006-09-28 15:52 christos 3949 3950 * history.c: Fix memory leak found by valgrind (Julien Torres) 3951 39522006-08-31 22:20 rpaulo 3953 3954 * Makefile, TEST/Makefile, TEST/tc1.c, TEST/test.c: Rename 3955 TEST/test.c to avoid problems when doing a cleandir on 3956 case-insensitive file systems. ok'ed christos. 3957 39582006-08-21 14:45 christos 3959 3960 * editline.3, editrc.5, filecomplete.c, filecomplete.h, read.h, 3961 readline.c, readline/readline.h: Change to a 3 clause copyright 3962 after permission of the holders. 3963 39642006-07-23 22:21 christos 3965 3966 * readline.c: PR/34062: Tanaka Akira: rl_deprep_term_function is 3967 NULL in libedit. Default to rl_deprep_terminal as suggested; do 3968 the same for rl_prep_term_function 3969 39702006-05-18 19:54 christos 3971 3972 * vi.c: change __weak_extern to __weak_reference so that gcc4 3973 works. 3974 39752006-04-09 03:36 christos 3976 3977 * map.c: fix debugging printf format. 3978 39792006-03-25 14:00 rtr 3980 3981 * readline.c: remove if/free block checking known condition 3982 3983 coverity 2762 / run 11 3984 39852006-03-23 21:22 christos 3986 3987 * key.c, key.h: move declaration to header file. 3988 39892006-03-21 18:52 christos 3990 3991 * readline.c: Coverity CID 2743: Not really a memory leak, but make 3992 it obvious that we always free tmp. 3993 39942006-03-18 20:23 christos 3995 3996 * term.c: Fix compilation. 3997 39982006-03-18 20:22 christos 3999 4000 * readline.c: Lint comment. 4001 40022006-03-18 10:31 christos 4003 4004 * term.c: Coverity CID 1668: Plug memory leak. 4005 40062006-03-18 10:28 christos 4007 4008 * readline.c: Coverity CID 1666: Plug memory leak. 4009 40102006-03-18 10:19 christos 4011 4012 * readline.c: Coverity CID 1667: Plug memory leak 4013 40142006-03-18 10:15 christos 4015 4016 * readline.c: Coverity CID 1662: Memory leak. 4017 40182006-03-18 10:09 christos 4019 4020 * tty.c: Coverity CID 597: remove dead code. 4021 40222006-03-18 10:07 christos 4023 4024 * tty.c: Coverity CID 1216: Prevent negative index use. 4025 40262006-03-18 10:02 christos 4027 4028 * term.c: Coverity CID 806: Prevent NULL deref 4029 40302006-03-06 22:11 christos 4031 4032 * chared.h, common.c, emacs.c, key.c, key.h, map.c, term.c, term.h, 4033 vi.c: Print the actual eofc, instead of ^D\b\b. Change internal 4034 character decoding to prevent buffer oveflows. 4035 40362006-03-06 22:11 christos 4037 4038 * readline.c: use the tty chars for reprint and eof instead of 4039 hard-coded ^R and ^D 4040 40412006-02-13 15:12 christos 4042 4043 * readline.c: PR/32817: Magnus Svensson: write_history and 4044 read_history returncode is not readline compatible. 4045 40462006-02-12 17:15 christos 4047 4048 * readline.c: Partial rl_getc_function support from Jess Thrysoee. 4049 40502005-11-09 23:11 christos 4051 4052 * refresh.c: Refresh bug reported by Julien Torres: 4053 4054 going from: activate -verbose to: reset -activation 4055 results in: reset -activationverbose" instead of: reset 4056 -activation 4057 4058 This is because we choose to insert "reset -" before the current 4059 line, and the delete "e -" and insert "ion" in the appropriate 4060 place. The cleareol code did not handle this case properly; we 4061 now cleareol to the maximum number of characters of the first 4062 difference, the second difference and the difference in line 4063 length. 4064 40652005-10-22 18:45 christos 4066 4067 * makelist: change tr '[a-z]' '[A-Z]' to tr '[:lower:]' '[:upper:]' 4068 so that POSIX systems work properly regardless of environment 4069 variable settings. 4070 40712005-10-12 11:29 wiz 4072 4073 * editline.3: Add el_get to SYNOPSIS. From jmc@openbsd. 4074 40752005-09-10 00:32 wiz 4076 4077 * editline.3: Fix double if (from Alexey E. Suslikov via 4078 jmc@openbsd). While here, re-word both H_[GS]ETUNIQUE 4079 descriptions so they make more sense. Bump date. 4080 40812005-08-19 06:21 christos 4082 4083 * el.c: PR/31012: Barry Naujok: libedit el_get with EL_EDITOR op 4084 does not work Fixed as suggested. 4085 40862005-08-10 14:46 christos 4087 4088 * vi.c: Don't save the el->el_line.cursor over a cv_insert call and 4089 use it later because it might change. From Stefan Farfedeler. 4090 40912005-08-09 18:40 christos 4092 4093 * vi.c: Don't delete the current line in vi mode when typing 'yy'. 4094 From Stefan Farfeleder. 4095 40962005-08-09 15:58 christos 4097 4098 * map.c: Fix two more help iterators. Thanks Stefan Farfeleder! 4099 41002005-08-08 16:05 christos 4101 4102 * chared.h, common.c, emacs.c, key.c, term.c, vi.c: Spelling 4103 mistakes and comment errors (from FreeBSD via Stefan Farfeleder; 4104 many thanks) 4105 41062005-08-08 16:04 christos 4107 4108 * makelist, map.c: Don't add an extra { NULL, 0, NULL } element to 4109 the help array. Instead keep it always the same size as the 4110 function array for consistency. Reported in FreeBSD PR 82381, but 4111 fixed differently. 4112 41132005-08-08 03:41 christos 4114 4115 * chared.c: The previous commit removed too much and forgot to 4116 reset the history event number. From Kouichirou Hiratsuka, many 4117 thanks! 4118 41192005-08-03 15:41 christos 4120 4121 * filecomplete.c: Fix reversed test; from Gerry Swislow 4122 41232005-08-02 14:11 christos 4124 4125 * read.c: On a fatal error, we want to stop processing the macro 4126 buffers. 4127 41282005-08-02 12:20 tron 4129 4130 * read.c: Add missing second argument to another call of 4131 ch_reset(). 4132 41332005-08-02 01:00 christos 4134 4135 * chared.c, chared.h, common.c, el.c, read.c: Don't reset the macro 4136 strings each time we enter el_gets(), otherwise el_push() is 4137 unusable programmatically. 4138 41392005-08-01 16:34 christos 4140 4141 * history.c: Don't forget to initialize h_del; from Julien Torres. 4142 41432005-07-14 17:02 wiz 4144 4145 * editline.3: Drop trailing whitespace. 4146 41472005-07-14 17:00 christos 4148 4149 * editline.3, histedit.h, history.c, readline.c, 4150 readline/readline.h: PR/30747: David N. Williams: libedit is 4151 missing remove_history() Added, please test. 4152 41532005-07-12 13:35 tron 4154 4155 * readline.c: Pull up revision 1.52 (requested by lukem in ticket 4156 #542): check for pwd != NULL, fix a missed getpwnam. 4157 41582005-07-12 13:33 tron 4159 4160 * readline.c: Pull up revision 1.50 (requested by lukem in ticket 4161 #542): use getpwent_r 4162 41632005-07-06 23:13 christos 4164 4165 * history.c, key.c: Fix memory leaks found by valgrind. From Julien 4166 Torres 4167 41682005-06-12 08:58 christos 4169 4170 * histedit.h: make this useable from c++. 4171 41722005-06-11 20:18 christos 4173 4174 * filecomplete.c, filecomplete.h, readline.c, readline/readline.h: 4175 PR/30500: Paul Shupak: Inconsistent definition of tilde_expand(). 4176 Provide a layer of indirection between the readline 4177 compatibility functions and our internal implementation, so that 4178 we have the freedom to change the function signature. 4179 41802005-06-10 22:21 christos 4181 4182 * filecomplete.c, filecomplete.h, readline.c: Bug reported from 4183 Martin Dietze: 4184 4185 The place to change the completion_append_character is 4186 usually somewhere in the `rl_completion_entry_function' 4187 callback which is where one usually can distinguish between 4188 file- or dir-like entries to append a slash for dirs etc. 4189 4190 This does no longer work since `fn_complete()' takes the 4191 `append_character' as argument before the callback is 4192 executed, 4193 so that changes to the variable 4194 `rl_completion_append_character' 4195 have in fact no effect for the current completion. 4196 4197 Fix by adding a function that returns the 4198 rl_completion_append_character, when it gets passed in a filename 4199 in readline emulation. 4200 42012005-06-10 22:18 christos 4202 4203 * readline/readline.h: tilde expand should take a const argument. 4204 42052005-06-01 13:37 lukem 4206 4207 * chared.c, read.c, tty.c, tty.h, TEST/test.c: Don't use 4208 non-standard uint or u_int. 4209 42102005-05-29 06:58 lukem 4211 4212 * parse.c, parse.h: Update for recent parse__escape() prototype 4213 change 4214 42152005-05-29 05:55 christos 4216 4217 * parse.c, tty.c: PR/25694: Luke Mewburn: Don't abuse 4218 unconstify'ing a string and writing to it, because you'll core 4219 dump. Also remove extra const that gives pain to the irix 4220 compiler. 4221 42222005-05-28 16:03 tron 4223 4224 * readline.c: Pull up revision 1.55 (requested by agc in ticket 4225 #353): Use the correct type for the stored callback function 4226 42272005-05-28 16:02 tron 4228 4229 * readline.c: Pull up revision 1.54 (requested by agc in ticket 4230 #353): Sync the alternative readline interface with reality: + 4231 the rl_callback_handler_install takes a pointer to a void 4232 function which has one char * argument (it's called that way in 4233 the readline emulation source, otherwise there's no way to pass 4234 the line buffer to the function which processes the line when 4235 EOL is encountered) + provide a prototype for that function 4236 signature and use it Makes the callback readline interface work 4237 now. 4238 42392005-05-28 16:02 tron 4240 4241 * readline/readline.h: Pull up revision 1.14 (requested by agc in 4242 ticket #353): Sync the alternative readline interface with 4243 reality: + the rl_callback_handler_install takes a pointer to a 4244 void function which has one char * argument (it's called that 4245 way in the readline emulation source, otherwise there's no way 4246 to pass the line buffer to the function which processes the 4247 line when EOL is encountered) + provide a prototype for that 4248 function signature and use it Makes the callback readline 4249 interface work now. 4250 42512005-05-28 14:03 lukem 4252 4253 * TEST/test.c: fix for WARNS=3 4254 42552005-05-28 14:02 lukem 4256 4257 * Makefile: clean up build of "test" 4258 42592005-05-28 13:55 lukem 4260 4261 * Makefile: MAKEVERBOSE support 4262 42632005-05-27 16:01 agc 4264 4265 * readline.c: Use the correct type for the stored callback function 4266 42672005-05-27 13:35 agc 4268 4269 * readline.c, readline/readline.h: Sync the alternative readline 4270 interface with reality: 4271 4272 + the rl_callback_handler_install takes a pointer to a void 4273 function which has one char * argument (it's called that way in 4274 the readline emulation source, otherwise there's no way to pass 4275 the line buffer to the function which processes the line when 4276 EOL is encountered) 4277 4278 + provide a prototype for that function signature and use it 4279 4280 Makes the callback readline interface work now. 4281 42822005-05-19 00:36 christos 4283 4284 * Makefile: Libedit depends on libterm. From Patrick Welche 4285 42862005-05-19 00:34 christos 4287 4288 * filecomplete.c: Make completion_matches non-static since readline 4289 wants it. 4290 42912005-05-18 02:50 christos 4292 4293 * TEST/test.c: Make signal handler safe. From Michael Knudsen, 4294 many thanks. 4295 42962005-05-16 15:14 lukem 4297 4298 * makelist: Remove clause 3 from the UCB license. 4299 43002005-05-12 17:48 christos 4301 4302 * filecomplete.c: PR/30215: Kouichirou Hiratsuka: /bin/sh dumps 4303 core with tabcomplete Don't core-dump when trying to complete an 4304 empty line; instead assume ./ 4305 43062005-05-09 22:10 dsl 4307 4308 * filecomplete.c: Use getpwuid_r(getuid(), ...) to expand ~/.... 4309 Don't replace ~xyz with /home/xyz when expanding ~ 4310 43112005-05-07 18:28 dsl 4312 4313 * filecomplete.c, filecomplete.h: gdb directly calls 4314 filename_completion_function() 4315 43162005-05-07 18:22 dsl 4317 4318 * Makefile: Make everything that uses makelist depend on Makefile - 4319 that way the created files pick up new entries. 4320 43212005-05-07 18:01 dsl 4322 4323 * Makefile, filecomplete.c, filecomplete.h, histedit.h, readline.c: 4324 Separate out the filename completion functions from the 4325 readline() code. Pass in loads of parameters instead of relying 4326 on shed-loads of global variables to modify the behaviour. The 4327 filename completion code can now be enabled by code that uses 4328 el_gets(). (eg /bin/sh) 4329 43302005-04-25 03:06 matt 4331 4332 * vi.c: Terminate the arglist with a NULL instead of 0. (Shuts up 4333 gcc4.x) 4334 43352005-04-19 05:29 christos 4336 4337 * readline.c: check for pwd != NULL, fix a missed getpwnam. 4338 43392005-04-13 00:01 christos 4340 4341 * readline.c, readline/readline.h: PR/29958: Peter Bex: add 4342 rl_variable_bind and rl_attempted_completion_over 4343 43442005-04-02 08:28 christos 4345 4346 * readline.c: use getpwent_r 4347 43482005-03-19 18:36 christos 4349 4350 * editline.3: PR/29738: Rui Paulo: Incorrect tok_line and tok_str 4351 declarations. 4352 43532005-03-15 01:10 christos 4354 4355 * term.h: Add missing define, needed for debugging (from Rob 4356 Rodgers) 4357 43582005-03-10 20:34 christos 4359 4360 * readline.c: Always update the position variables before the map 4361 function is called. From Rob Rodgers, thanks! 4362 43632005-03-10 00:55 christos 4364 4365 * readline.c: set UNBUFFERED again after you do the line callback 4366 so that the new line gets refreshed. 4367 43682005-03-10 00:55 christos 4369 4370 * read.c: Make sure we flush after we prepare when we are 4371 unbuffered otherwise the prompt will not appear immediately. 4372 43732004-11-27 19:31 christos 4374 4375 * history.c: PR/26785: Jess Thrysoee: libedit - H_NEXT and H_PREV 4376 shifts cursor on failure 4377 43782004-11-04 02:16 christos 4379 4380 * search.c: Make EM_DELETE_PREV_CHAR behave like 4381 ED_DELETE_PREV_CHAR in incremental search. From Gerry Swislow. 4382 43832004-10-28 23:14 dsl 4384 4385 * emacs.c: Use (unsigned char) cast to sanitise arguments to ctype 4386 functions. 4387 43882004-10-27 21:59 dsl 4389 4390 * emacs.c: Fix a load of international alphabet problems with 4391 isxxx() and toupper() Change isspace(*char_ptr) to 4392 isspace(*char_ptr & 0xff) so that the correct piece of memory is 4393 looked at for the bit mask. gcc optimises out the '& 0xff' (on 4394 i386 at least). Fixes problems found by gcc when the splurious 4395 (int) cast is removed from the #defines in ctype.h 4396 43972004-09-08 20:15 christos 4398 4399 * readline.c: cut out the middle-man and use el_insertstr() 4400 directly. 4401 44022004-09-08 20:15 christos 4403 4404 * readline/readline.h: make rl_inhibit_completion visible. 4405 44062004-08-24 14:41 christos 4407 4408 * history.c: make sure that we round up to 1K. 4409 44102004-08-20 14:54 christos 4411 4412 * history.c: PR/26725: Sergey S. Kostyliov: Typo in libedit, 4413 possible buffer overflow in 4414 src/lib/libedit/history.c:history_save() 4415 44162004-08-13 14:10 mycroft 4417 4418 * chared.c, chared.h, emacs.c, map.c, tty.c, vi.c: 4419 Delete-previous-char and delete-next-char without an argument are 4420 not supposed to modify the yank buffer in Emacs. Make it so. 4421 44222004-07-10 11:28 tron 4423 4424 * el.c: Pull up revision 1.39 (requested by christos in ticket 4425 #620): PR/23486: Andreas Gustafsson: gdb no longer works with 4426 emacs - make sure that we keep previous contents of the buffer in 4427 unbuffered mode. - when turning editing on and off keep tty 4428 consistent. 4429 44302004-07-10 11:28 tron 4431 4432 * read.c: Pull up revision 1.34 (requested by christos in ticket 4433 #620): PR/23486: Andreas Gustafsson: gdb no longer works with 4434 emacs - make sure that we keep previous contents of the buffer in 4435 unbuffered mode. - when turning editing on and off keep tty 4436 consistent. 4437 44382004-07-08 02:51 christos 4439 4440 * el.c, read.c: PR/23486: Andreas Gustafsson: gdb no longer works 4441 with emacs - make sure that we keep previous contents of the 4442 buffer in unbuffered mode. - when turning editing on and off 4443 keep tty consistent. 4444 44452004-05-23 01:21 christos 4446 4447 * term.c: fix memory leak; thanks to Logan Gabriel 4448 44492004-04-15 10:13 wiz 4450 4451 * editline.3: Remove duplicate word, from jfb@openbsd via 4452 jmc@openbsd. 4453 44542004-02-27 15:52 christos 4455 4456 * el.c, read.c, read.h, readline.c: Better fix for 4457 rl_prep_terminal() from Gerry Swislow. 4458 44592004-02-21 17:42 christos 4460 4461 * el.c, read.c, read.h: Separate tty separation from the prompt 4462 printing function. From Gerry Swislow. 4463 44642004-01-17 18:57 christos 4465 4466 * read.c, readline.c, sys.h, term.c, readline/readline.h: 4467 portability fixes. 4468 44692003-12-08 13:03 lukem 4470 4471 * TEST/test.c: update for function name change 4472 44732003-12-05 14:46 wiz 4474 4475 * editline.3: Use Aq instead of <>, quote a minus, drop trailing 4476 space. 4477 44782003-12-05 14:37 lukem 4479 4480 * Makefile, editline.3, histedit.h, parse.c, readline.c, 4481 shlib_version, tokenizer.c, tokenizer.h, TEST/Makefile, 4482 TEST/test.c: Tokenization function enhancements: * Make 4483 tok_init(), tok_end(), tok_reset(), tok_line() and tok_str() 4484 publically available in <histedit.h> * Documented the public 4485 functions in editline(3) * Renamed tok_line() -> tok_str() * 4486 Added new tok_line() which takes a "const LineInfo *" instead of 4487 "const char *" (the former has "cursor" information), and 4488 optionally return the argv index ("int *cursorc") and offset 4489 within that index ("int *cursorv"). This means that completion 4490 routines can use the tokenization code to crack the line and 4491 easily find which word the cursor is at. (mmm, context 4492 sensitive completion :) * Fixed TEST/test.c when using 4493 "continuation" lines (unmatched quote or \ at EOL), and added 4494 some more DEBUG messages including highlighting where the 4495 cursor is (with a `_'). 4496 44972003-11-04 14:22 christos 4498 4499 * editline.3: s/wth/with/ 4500 45012003-11-03 04:22 christos 4502 4503 * readline.c: Fix uninitialized variable. 4504 45052003-11-02 21:08 christos 4506 4507 * chared.c: Always use el->el_buffer, because newbuffer could have 4508 moved. From Gerry Swislow gerry at certif dot com 4509 45102003-11-02 21:07 christos 4511 4512 * emacs.c: If the kill buffer is empty return normal. From Gerry 4513 Swislow gerry at certif dot com 4514 45152003-11-02 21:06 christos 4516 4517 * parse.c: Handle M- as escape. XXX: should probably select the 4518 meta-map instead. From Gerry Swislow gerry at certif com 4519 45202003-11-02 02:45 christos 4521 4522 * readline.c: From: Gerry Swislow gerry at certif dot com 4523 4524 1) File name completion should list the files in the current 4525 directory if no text is entered. The previous version wouldn't 4526 list anything if the text to complete was empty. 4527 4528 2) When listing directories, the entries "." and ".." shouldn't 4529 be shown. 4530 4531 3) The filename completion should be used if the user's 4532 rl_attempted_completion_function doesn't return any matches. The 4533 previous version didn't do that. 4534 45352003-11-02 00:39 christos 4536 4537 * readline.c: initialize ptr. 4538 45392003-11-02 00:37 christos 4540 4541 * editline.3: Explain H_ADD better. from Otto Moerbeek otto at 4542 drijf dot net 4543 45442003-11-02 00:36 christos 4545 4546 * hist.c: Fixes from Otto Moerbeek otto at drijf dot net 4547 45482003-11-02 00:35 christos 4549 4550 * editrc.5: Document history builtin commands. 4551 45522003-10-27 23:26 christos 4553 4554 * readline.c, readline/readline.h: Make readline csh-like history 4555 work. From Gerry Swislow <gerry at certif dot com>. 4556 45572003-10-25 08:42 christos 4558 4559 * search.c: Another fix for incremental search prev. 4560 45612003-10-19 08:28 christos 4562 4563 * readline.c: add rl_catch_signals 4564 45652003-10-19 03:26 wiz 4566 4567 * editrc.5: Bump date for previous. 4568 45692003-10-19 01:48 christos 4570 4571 * chared.c, chared.h, el.c, el.h, history.c, key.c, read.c, 4572 tokenizer.c: change allocation policy in el_push to allocate the 4573 string itself. fix issues with strdup. 4574 45752003-10-19 01:27 christos 4576 4577 * search.c, search.h: make forward incremental search work better. 4578 45792003-10-19 00:37 christos 4580 4581 * tty.c: remove debugging printf. 4582 45832003-10-19 00:24 christos 4584 4585 * editrc.5, tty.c: Allow setty to set chars using char=value 4586 45872003-10-17 20:49 christos 4588 4589 * search.c: When searching backwards don't include the characters 4590 after the cursor in the search. 4591 45922003-10-17 17:33 wiz 4593 4594 * editline.3: Bump date for previous. Replace > with \*[Gt]. 4595 45962003-10-17 00:26 christos 4597 4598 * editline.3, el.c, histedit.h, readline.c, readline/readline.h: 4599 More libedit readline emulation functions from: Gerry Swislow 4600 <gerry at certif dot com> 4601 46022003-10-16 23:41 christos 4603 4604 * TEST/Makefile: I got tired of typing a cc line. 4605 46062003-10-16 23:41 christos 4607 4608 * search.c: Fix incremental search which was badly busted. 4609 46102003-10-15 20:08 christos 4611 4612 * parse.c, readline.c: don't limit ^c to alpha c, and add 4613 VIS_NOSLASH so that vis(3) does not produce \^c 4614 46152003-10-09 02:42 christos 4616 4617 * read.c, readline.c: PR/23107: Nathan Williams: ^D as the first 4618 char on the command line does not DTRT in readline compatibility 4619 mode 4620 46212003-09-26 23:09 wiz 4622 4623 * editline.3: New sentence, new line; bump date for previous. 4624 46252003-09-26 19:44 christos 4626 4627 * editline.3, el.c, el.h, histedit.h, read.c, read.h, readline.c, 4628 shlib_version, readline/readline.h: Implement enough of 4629 readline's 4.0 async mode to make gdb happy. This is not complete 4630 yet, but it seems to work... This required to introduce an 4631 unbuffered mode to el_gets(), but that was a minor change. 4632 46332003-09-15 13:33 tron 4634 4635 * readline/readline.h: Include "sys/ttydefaults.h" to get standard 4636 definition of "CTRL" macro which avoids clash with custom one. 4637 46382003-09-15 03:29 christos 4639 4640 * readline/readline.h: kludge around CTRL redef. 4641 46422003-09-15 00:15 christos 4643 4644 * readline.c, readline/readline.h: Match the stupid function 4645 pointer declarations with actual readline's 4.0. This is gross. 4646 46472003-09-14 23:55 christos 4648 4649 * readline.c: make this compile. 4650 46512003-09-14 23:55 christos 4652 4653 * readline/readline.h: Avoid pre-ansi warning. 4654 46552003-09-14 23:48 christos 4656 4657 * el.c, readline.c, shlib_version, term.c, term.h, 4658 readline/readline.h: - provide enough hooks to compile gdb-5.3 - 4659 fix el_get(e, EL_TERMINAL, (char **)) 4660 46612003-09-13 06:18 mycroft 4662 4663 * read.c: Fix something that's been annoying me for a while... 4664 Pull in <fcntl.h>, so that the fcntl #defines are present, and we 4665 build in the automatic reset of non-blocking mode, rather than 4666 beeping like mad. 4667 46682003-08-07 18:44 agc 4669 4670 * chared.c, chared.h, common.c, el.c, el.h, emacs.c, hist.c, 4671 hist.h, histedit.h, history.c, key.c, key.h, map.c, map.h, 4672 parse.c, parse.h, prompt.c, prompt.h, read.c, refresh.c, 4673 refresh.h, search.c, search.h, sig.c, sig.h, sys.h, term.c, 4674 term.h, tokenizer.c, tokenizer.h, tty.c, tty.h, vi.c, 4675 TEST/test.c: Move UCB-licensed code from 4-clause to 3-clause 4676 licence. 4677 4678 Patches provided by Joel Baker in PR 22280, verified by myself. 4679 46802003-08-03 11:23 lukem 4681 4682 * readline/Makefile: Add INCSYMLINKS to <bsd.inc.mk> and 4683 <bsd.kinc.mk>, and use that instead of SYMLINKS to install 4684 symlinked header files. INCSYMLINKS are installed with 'make 4685 includes'. This avoids using SYMLINKS and hacks with the 4686 'linkinstall' target in <bsd.links.mk>, as linksinstall occurs in 4687 'make install' and hacks to get it to occur in 'make includes' 4688 weren't robust, as seen in lib/libdes. 4689 4690 Yet more improvements to bsd.README. 4691 46922003-08-01 19:03 lukem 4693 4694 * Makefile: Rework how dependency generation is performed: 4695 4696 * DPSRCS contains extra dependencies, but is _NOT_ added to 4697 CLEANFILES. This is a change of behaviour. If a Makefile 4698 wants the clean semantics it must specifically append to 4699 CLEANFILES. Resolves PR toolchain/5204. 4700 4701 * To recap: .d (depend) files are generated for all files in SRCS 4702 and DPSRCS that have a suffix of: .c .m .s .S .C .cc .cpp .cxx 4703 4704 * If YHEADER is set, automatically add the .y->.h to DPSRCS & 4705 CLEANFILES 4706 4707 * Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon 4708 ${DPSRCS} 4709 4710 * Deprecate the (short lived) DEPENDSRCS 4711 4712 Update the various Makefiles to these new semantics; generally 4713 either adding to CLEANFILES (because DPSRCS doesn't do that 4714 anymore), or replacing specific .o dependencies with DPSRCS 4715 entries. 4716 4717 Tested with "make -j 8 distribution" and "make distribution". 4718 47192003-07-31 14:46 lukem 4720 4721 * Makefile: tweak this unconventional (some might say "baroque") 4722 Makefile to work with the new <bsd.dep.mk> *.d semantics. fixes 4723 problems highlighted by Martin Husemann <martin@> 4724 47252003-07-16 13:54 wiz 4726 4727 * editline.3: Bump date for last. 4728 47292003-07-15 00:36 jeremy 4730 4731 * editline.3: Documented the return values from el_get(). 4732 47332003-06-27 20:57 wiz 4734 4735 * editrc.5: Add Ns. 4736 47372003-06-19 18:19 christos 4738 4739 * sys.h: provide a definition for __attribute__ 4740 47412003-06-19 18:04 christos 4742 4743 * readline.c: From michael@moria.de: Fix realloc case where we 4744 could be running out of space if too many matches. 4745 47462003-06-19 17:55 christos 4747 4748 * common.c, el.c, emacs.c, hist.c, history.c, key.h, prompt.c, 4749 read.c, readline.c, refresh.c, term.c, tty.c, vi.c: From 4750 michael@moria.de: - use __attribute__((__unused__)) in arguments 4751 where appropriate. - some int -> size_t and char * to const char 4752 * conversions. 4753 47542003-06-06 15:33 wiz 4755 4756 * editline.3: Use Aq Pa instead of Fd \*[Lt]...\*[Gt]. From 4757 jmc@openbsd. 4758 47592003-06-04 22:14 matt 4760 4761 * vi.c: Only return CC_EOF if ^D (VEOF) was the only thing on the 4762 line. Otherwise beep and don't do anything else. This mimics 4763 the behavor of ^D outside in normal terminal mode. (^D in vi 4764 scrolls forwards and as such isn't appropriate to emulation) 4765 47662003-05-14 09:24 wiz 4767 4768 * editrc.5: setup -> set up, from jmc@openbsd. 4769 47702003-05-08 15:22 christos 4771 4772 * Makefile: add a missing dependency (John Gordon) 4773 47742003-05-08 15:20 christos 4775 4776 * Makefile: Use ${HOST_SH} 4777 47782003-04-16 15:35 wiz 4779 4780 * editline.3: Use .In header.h instead of .Fd #include 4781 \*[Lt]header.h\*[Gt] Much easier to read and write, and supported 4782 by groff for ages. Okayed by ross. 4783 47842003-03-31 18:52 perry 4785 4786 * editrc.5, emacs.c: em-gosmacs-traspose->em-gosmacs-transpose 4787 (Igor Sobrado, PR misc/19909) 4788 47892003-03-29 23:48 wiz 4790 4791 * readline.c: Consistently spell occurrence with two rs. 4792 47932003-03-15 21:52 he 4794 4795 * refresh.c: Pull up revision 1.19 (via patch, requested by msaitoh 4796 in ticket #14): Since we have opost and onlcr set, we don't 4797 need to output \r; \n is sufficient. Fixes PR#17954. 4798 47992003-03-10 22:21 christos 4800 4801 * makelist: don't use the path for awk 4802 48032003-03-10 22:18 christos 4804 4805 * refresh.c: s/u_int32_t/unsigned int/ 4806 48072003-03-10 12:09 dsl 4808 4809 * vi.c: Put the __weak_extern() back inside vi_alias, but after the 4810 extern for get_alias_text(). 4811 48122003-03-10 10:55 he 4813 4814 * vi.c: Move the __weak_extern() (ifdef'ed) outside of the 4815 vi_alias() function, so that this compiles again. 4816 48172003-03-10 02:14 christos 4818 4819 * readline.c: null is not 0 4820 48212003-03-10 02:14 christos 4822 4823 * vi.c: if no __weak_extern, don't even try to do vi_alias. 4824 48252003-03-10 02:05 christos 4826 4827 * vi.c: fix uninitialized variable. grr, I want gcc-3.3 4828 48292003-03-10 01:58 christos 4830 4831 * sig.c, sig.h: sig_t is non portable 4832 48332003-03-10 01:57 christos 4834 4835 * sys.h: - include cdefs.h early in the game - ifdef notdef the 4836 sunos stuff - no need for sig_t 4837 48382003-03-10 01:56 christos 4839 4840 * readline.c: include alloca.h for systems that need it. 4841 48422003-02-25 11:34 wiz 4843 4844 * editline.3: .Nm does not need a dummy argument ("") before 4845 punctuation or for correct formatting of the SYNOPSIS any longer. 4846 48472003-01-22 00:00 wiz 4848 4849 * editline.3: Replace -1 with \-1 for PostScript output; drop a 4850 trailing space and fix two typos. 4851 48522003-01-21 19:40 christos 4853 4854 * editline.3, hist.c, hist.h, histedit.h, history.c, parse.c: Add a 4855 uniquefier for the history function. 4856 48572003-01-21 18:41 christos 4858 4859 * readline.c: fix directory descriptor leak [from michael at moria 4860 dot de] 4861 48622003-01-05 09:40 jmc 4863 4864 * refresh.c: Pull up revisions 1.18-1.19 (requested by masanobu in 4865 ticket #1048) PR/17954: SAITOH Masanobu: since we have opost and 4866 onlcr set, we don't need to output \r to go to the end of line; 4867 \n is enough. From David Laight. 4868 48692002-11-20 17:50 christos 4870 4871 * chared.c, chared.h, common.c, read.c, search.c: Fix problem with 4872 previous patches that broke vi history. - c_gets() was usually 4873 returning a length, but sometimes one of the CC_xxx values 4874 (which are small +ve integers)! - fixed c_gets() by putting a ' ' 4875 under the cursor. From David Laight. 4876 48772002-11-15 15:33 christos 4878 4879 * refresh.c: de-lint 4880 48812002-11-15 15:32 christos 4882 4883 * chared.c, chared.h, common.c, el.h, emacs.c, hist.c, hist.h, 4884 histedit.h, map.c, read.c, refresh.c, search.c, search.h, vi.c: 4885 PR/18995: David Laight: libedit fixes for posix conformant sh 4886 4887 The posix 'sh' specification defines vi-mode editing quite 4888 tightly. The netbsd libedit code (used by sh to do this) was 4889 missing several features, there were also minor errors in others. 4890 4891 Compare netbsd sh to the definition available from: 4892 http://www.opengroup.org/onlinepubs/007904975/utilities/sh.html 4893 In particular the following were not supported: U - undo all 4894 changes to line | - goto column Y - yank to end of 4895 line y - yank # - comment out current line @ - 4896 take input from shell alias [1] G - goto numbered line in 4897 history buffer v - edit history line with vi _ - append 4898 word from last input line . - redo last command Other minor 4899 changes have also been made. 4900 4901 [1] This needs the shell to define an appropriate routine to 4902 return the text of the alias. There is no requirement that such 4903 a function exist. 4904 49052002-11-12 01:01 thorpej 4906 4907 * refresh.c: Fix signed/unsigned comparison warnings. 4908 49092002-11-12 01:00 thorpej 4910 4911 * el.c: Avoid strict alias warning. 4912 49132002-10-31 03:01 christos 4914 4915 * map.c, vi.c: support for % command [matching 4916 parens/brackets/braces] on vi modes. From David Laight, thanks! 4917 49182002-10-27 22:43 christos 4919 4920 * readline.c: remove unused variables. 4921 49222002-10-27 22:41 christos 4923 4924 * Makefile, chared.c, chared.h, common.c, el.h, emacs.c, map.c, 4925 read.c, readline.c, refresh.c, vi.c: vi mode and memory fixes 4926 from david laight. 4927 49282002-10-27 21:24 christos 4929 4930 * history.c, readline.c, tokenizer.c: don't crash in memory 4931 shortage conditions. 4932 49332002-10-27 21:04 christos 4934 4935 * refresh.c: PR/17954: SAITOH Masanobu: since we have opost and 4936 onlcr set, we don't need to output \r to go to the end of line; 4937 \n is enough. From David Laight. 4938 49392002-10-13 19:15 christos 4940 4941 * history.c: write the vis(3) converted string into the file, not 4942 the original one. Noted by Tim Robbins. Hi luke! 4943 49442002-10-02 13:06 wiz 4945 4946 * editrc.5: empty, not emptry. By Adrian Mrva. 4947 49482002-10-01 21:06 wiz 4949 4950 * editline.3: New sentence, new line. From Robert Elz. 4951 49522002-08-19 16:55 lukem 4953 4954 * Makefile: Explicitly move setting of NOxxx and USE_SHLIBDIR to 4955 the top of the Makefile (before including <bsd.own.mk>) 4956 49572002-08-19 15:35 lukem 4958 4959 * readline/Makefile: More use of ${NETBSDSRCDIR}/some/path instead 4960 of ${.CURDIR}/../../some/path 4961 49622002-08-18 09:23 yamt 4963 4964 * editline.3: reflect reality. (3rd arg of el_parse is const.) 4965 49662002-08-09 12:03 soren 4967 4968 * TEST/test.c: Remove extraneous \n's in {err,warn}{,x}. 4969 49702002-04-09 03:57 thorpej 4971 4972 * readline.c: _rl_qsort_string_compare(): Fix casts. This makes 4973 gcc 3.2 happy, and also allows both LINTED comments to be 4974 removed. 4975 49762002-03-24 00:39 christos 4977 4978 * TEST/test.c: make sure this compiles cleanly and works. 4979 49802002-03-18 17:20 christos 4981 4982 * Makefile, readline.c: Add a couple linted comment and enable 4983 WARNS=3 4984 49852002-03-18 17:19 christos 4986 4987 * config.h: oops, we need config.h now. 4988 49892002-03-18 17:00 christos 4990 4991 * chared.c, chared.h, common.c, el.c, el.h, emacs.c, hist.c, 4992 hist.h, histedit.h, history.c, key.c, key.h, map.c, map.h, 4993 parse.c, prompt.c, read.c, readline.c, refresh.c, search.c, 4994 sig.c, sys.h, term.c, term.h, tokenizer.c, tokenizer.h, tty.c, 4995 tty.h, vi.c, TEST/test.c, readline/readline.h: - constify; passes 4996 all gcc and lint strict checks. - add config.h [Jason Evans], to 4997 create a portable version of libedit that can be easily 4998 compiled on other OS's. 4999 50002002-02-20 12:54 wiz 5001 5002 * editline.3: Close quoting. 5003 50042002-02-07 08:00 ross 5005 5006 * editline.3: Generate <>& symbolically. 5007 50082002-02-04 00:37 christos 5009 5010 * chared.h: Fixed an __P remnant 5011 50122002-02-04 00:37 christos 5013 5014 * el.c: Don't use HAVE_ yet. 5015 50162002-02-04 00:30 christos 5017 5018 * el.c: Fix a warning. 5019 50202002-01-31 03:27 christos 5021 5022 * tokenizer.c: don't forget to re-adjust the limit. 5023 50242002-01-31 01:25 christos 5025 5026 * tokenizer.c: make pointer arithmetic more palatable. 5027 50282002-01-15 03:46 wiz 5029 5030 * editrc.5: Punctuation nits. 5031 50322002-01-15 03:46 wiz 5033 5034 * editline.3: Punctuation and whitespace nits, fix a typo. 5035 50362001-12-28 02:32 lukem 5037 5038 * Makefile: * Add user-controlled mk.conf variables - SHLIBDIR 5039 Location to install shared libraries if ${USE_SHLIBDIR} 5040 is "yes". Defaults to "/usr/lib". 5041 5042 - USE_SHLIBDIR If "yes", install shared libraries in 5043 ${SHLIBDIR} 5044 instead of ${LIBDIR}. Defaults to "no". 5045 Sets ${_LIBSODIR} to the appropriate 5046 value. 5047 This may be set by individual Makefiles 5048 as well. 5049 5050 - SHLINKDIR Location of shared linker. Defaults to 5051 "/usr/libexec". 5052 If != "/usr/libexec", change the 5053 dynamic-linker 5054 encoded in shared programs 5055 5056 * Set USE_SHLIBDIR for libraries used by /bin and /sbin: 5057 libc libcrypt libcrypto libedit libipsec libkvm libm libmi387 5058 libtermcap libutil libz 5059 5060 * If ${_LIBSODIR} != ${LIBDIR}, add symlinks from 5061 ${LIBDIR}/${LIB}.so* to ${_LIBSODIR}/${LIB}.so* for 5062 compatibility. 5063 5064 * Always install /sbin/init statically (for now) 5065 5066 The net effect of these changes depends on how the variables are 5067 set: 5068 5069 1.) If nothing is set or changed, there is no change from the 5070 current behaviour: 5071 - Static /bin, /sbin, and bits of /usr/* 5072 - Dynamic rest 5073 - Shared linker is /usr/libexec/ld*so 5074 5075 2.) If the following make variables are set: 5076 LDSTATIC= 5077 SHLINKDIR=/lib 5078 SHLIBDIR=/lib 5079 Then the behaviour becomes: 5080 - Dynamic tools 5081 - .so libraries used by /bin and /sbin are 5082 installed to /lib, 5083 with symlinks from /usr/lib/lib*so to -> 5084 /lib/lib*so 5085 where appropriate 5086 - Shared linker is /lib/ld*so 5087 5088 3.) As per 2.), but add the following variable: 5089 USE_SHLIBDIR=yes 5090 This forces all .so's to be instaleld in /lib (with 5091 compat 5092 symlinks), not just those tagged by their Makefiles to 5093 be. 5094 Again, compat symlinks are installed 5095 50962001-12-12 01:51 tv 5097 5098 * readline/Makefile: Readability cleanups; MKfoo=no -> NOfoo. 5099 51002001-11-08 20:39 mycroft 5101 5102 * term.c: In the `not what I asked for' department: Do NOT return 5103 an error from term_init() if term_set() fails. Otherwise 5104 el_init() barfs and libedit fails to work. 5105 51062001-11-08 20:34 mycroft 5107 5108 * el.c: Remove an unused variable. 5109 51102001-11-02 05:47 christos 5111 5112 * el.c: If term_init() fails, cleanup and return NULL. This avoids 5113 other lossage. Pointed by charles. 5114 51152001-11-02 05:42 christos 5116 5117 * term.c: Finish initializing all the term data structures even if 5118 the terminal init fails. This makes editline work on dumb 5119 terminals again. Noted by mycroft. Oops, too agressive error 5120 checking. 5121 51222001-10-09 15:50 christos 5123 5124 * editline.3, el.c, el.h, histedit.h, shlib_version: PR/14188: 5125 Anthony Mallet: Provide an opaque data pointer to client 5126 programs. 5127 51282001-10-04 02:45 lukem 5129 5130 * editline.3: a couple of minor fixes. originally by Ruslan 5131 Ermilov <ru@FreeBSD.org>, highlighted to me by way of Mike 5132 Barcroft <mike@FreeBSD.org> (thanks!) 5133 51342001-09-29 19:52 jdolecek 5135 5136 * history.c: history_def_enter: fix off-by-one mistake in delete 5137 condition (the behaviour to keep at least one entry on the 5138 history list is retained) This fixes lib/9704 by Phil Nelson. 5139 51402001-09-27 21:29 christos 5141 5142 * editline.3, el.c, el.h, histedit.h, read.c, read.h: PR/14067: 5143 Anthony Mallet: Provide a programmatic way to set the read_char 5144 function via a new el_set() operation. Thanks, nicely done :-) 5145 51462001-09-24 15:22 wiz 5147 5148 * el.c: va_{start,end} audit: Make sure that each va_start has one 5149 and only one matching va_end, especially in error cases. If the 5150 va_list is used multiple times, do multiple va_starts/va_ends. 5151 If a function gets va_list as argument, don't let it use va_end 5152 (since it's the callers responsibility). 5153 5154 Improved by comments from enami and christos -- thanks! 5155 5156 Heimdal/krb4/KAME changes already fed back, rest to follow. 5157 5158 Inspired by, but not not based on, OpenBSD. 5159 51602001-06-19 15:42 wiz 5161 5162 * editrc.5: `existent', not `existant' 5163 51642001-05-17 03:02 christos 5165 5166 * chared.c, hist.c, key.c, tty.c: PR/12963:Jason Waterman: Fix 5167 signed cast problems. 5168 51692001-05-16 09:09 enami 5170 5171 * readline/Makefile: Use relative path for symlink target so that 5172 it won't point outside of tree. 5173 51742001-05-14 20:39 jdolecek 5175 5176 * readline/Makefile: Back off previous and do differently: Ensure 5177 that the <readline/history.h> link to <readline/readline.h> is 5178 installed too for 'make includes'. Also, avoid creating obj dir. 5179 This is finally real fix for lib/12929. XXX Is this right? 5180 51812001-05-14 09:41 jdolecek 5182 5183 * readline/Makefile: Use <bsd.inc.mk>, instead of <bsd.prog.mk>, so 5184 that the readline.h header is installed during the 'make 5185 includes'. Fixes lib/12929 by Martin Husemann. 5186 51872001-04-13 03:04 lukem 5188 5189 * chared.c: knf ch_enlargebufs(), to be *consistent* with the rest 5190 of this file... 5191 51922001-04-13 02:53 lukem 5193 5194 * refresh.c: rename 3 arg ELRE_DEBUG to ELRE_ASSERT, add 2 arg 5195 ELRE_DEBUG, and change all occurences of ELRE_DEBUG(foo,bar,) -> 5196 ELRE_DEBUG(foo,bar). some compilers (e.g, gcc on darwin) bitch 5197 about the former (`not enough args'). 5198 51992001-04-02 20:29 wiz 5200 5201 * editline.3: End sentence with a dot. 5202 52032001-03-20 01:08 christos 5204 5205 * history.c: chmod the history file to 600 so that only the owner 5206 can read it. [inspired by the openbsd fix to readline] 5207 52082001-01-23 16:55 jdolecek 5209 5210 * key.c, key.h, parse.c, search.c, term.c: sprinkle couple const 5211 52122001-01-10 23:42 jdolecek 5213 5214 * term.c: term_rebuffer_display(): set el->el_term.t_size.v to 5215 terminals height, not a magic value, so that e.g. el_display[] 5216 and el_vdisplay[] are not bigger than needed. Discussed with 5217 Christos Zoulas. 5218 52192001-01-10 09:10 jdolecek 5220 5221 * readline.c: fix partial completion - we failed to refresh screen 5222 in that case 5223 52242001-01-10 08:45 jdolecek 5225 5226 * chared.c, chared.h, common.c, emacs.c, hist.c, hist.h, prompt.c, 5227 read.c, refresh.c, refresh.h: Enlarge editline buffers as needed 5228 to support arbitrary length lines. This also addresses lib/9712 5229 by Phil Nelson. 5230 52312001-01-09 20:43 jdolecek 5232 5233 * term.c: term_beep(): use ordinary bell, don't attempt to use 5234 visual bell - if user wants visual instead of ordinary bell, they 5235 should set their environment appropriately 5236 52372001-01-09 20:22 jdolecek 5238 5239 * makelist: make array of functions and help array const 5240 52412001-01-09 18:31 jdolecek 5242 5243 * sig.c, tty.c: make constant arrays a const 5244 52452001-01-09 18:22 jdolecek 5246 5247 * map.c, map.h, term.c: make constant arrays a const 5248 52492001-01-06 15:44 jdolecek 5250 5251 * el.h: el_line_t: make 'limit' const 5252 52532001-01-05 23:45 christos 5254 5255 * el.c, readline.c: depoison the pure editline code from readline 5256 compatibility hacks. 5257 52582001-01-05 22:15 jdolecek 5259 5260 * Makefile, readline.c, readline.h, readline/Makefile, 5261 readline/readline.h: Standard location of readline headers is 5262 /usr/include/readline/, so install them there. readline.h of 5263 libedit had to move to subdirectory 'readline', due to the way 5264 BSD makefiles work; this is better than potentially fragile 5265 Makefile hacks 5266 52672001-01-04 16:56 christos 5268 5269 * chared.c, hist.c, key.c, map.c, search.c, term.c, term.h, 5270 tokenizer.c: consistently check for allocation failures and 5271 return -1, if we could not get more memory. 5272 52732001-01-04 16:55 christos 5274 5275 * readline.c: fix lint problems. 5276 52772001-01-04 16:55 christos 5278 5279 * sig.c: fix dumb typo in signal setup [from OpenBSD] return -1 if 5280 alloc fails. 5281 52822001-01-01 16:54 jdolecek 5283 5284 * shlib_version: bump libedit minor - addition of 5285 rl_special_prefixes and rl_completion_append_character 5286 52872001-01-01 16:52 jdolecek 5288 5289 * readline.c, readline.h: Add support for 5290 rl_completion_append_character and rl_special_prefixes. This 5291 addresses lib/10513 by Giles Lean. Tested with PostgreSQL 7.0.2 5292 psql. 5293 52942001-01-01 12:03 jdolecek 5295 5296 * readline.c: history_tokenize(): fix one off-by-one bug 5297 rl_complete_internal(): only replace the completed string with 5298 common part of possible matches if there is a possible 5299 completion 5300 53012000-12-31 10:50 jdolecek 5302 5303 * readline.c: rl_display_match_list(): * pad entries shorter than 5304 'max' by spaces correctly * fix off-by-one error which caused 5305 extra newline to be printed if the list fit exactly to 5306 a screen * fix typo in _rl_qsort_string_compare, which caused 5307 the list to not be sorted after all 5308 53092000-12-30 23:46 jdolecek 5310 5311 * term.c: term_beep(): if terminal supports both visual and 5312 ordinary bell, 'ring' both 5313 53142000-12-23 23:07 jdolecek 5315 5316 * shlib_version: bump libedit minor - added some public stuff for 5317 readline emulation 5318 53192000-12-23 23:02 jdolecek 5320 5321 * readline.c, readline.h: completion_matches(): fix a off-by-one 5322 bug, fix variable name typo implement displaying of possible 5323 completions, add hook to display the list on second 5324 rl_complete() invocation in row (typically, double <TAB>) 5325 5326 This addresses the completion part of lib/11581 by Richard 5327 Earnshaw. 5328 53292000-11-28 23:37 jmc 5330 5331 * term.c: Alloc the keys structure with A_K_NKEYS as the multiplier 5332 rather than a hardcoded value of 4. 5333 5334 A_K_NKEYS is currently 6 and this mismatch was stomping memory 5335 when initializing the keys. (specifically gdb lost the exec file 5336 name if it was a long path name). 5337 53382000-11-11 23:18 christos 5339 5340 * chared.c, el.c, el.h, key.c, map.c, read.c, term.c, term.h: - add 5341 support for home and end keys. - improve debugging support 5342 53432000-11-08 01:09 lukem 5344 5345 * editrc.5: improve description of line syntax 5346 53472000-10-04 18:21 sommerfeld 5348 5349 * key.c, term.c: format string audit (silence warnings, save space) 5350 53512000-09-05 01:45 lukem 5352 5353 * makelist: - generate ansi prototypes instead of using __P(). 5354 noted by christos - fix a couple of comments 5355 53562000-09-05 01:36 lukem 5357 5358 * TEST/test.c: convert to new style guide 5359 53602000-09-05 00:06 lukem 5361 5362 * chared.c, chared.h, common.c, el.c, el.h, emacs.c, hist.c, 5363 hist.h, histedit.h, history.c, key.c, key.h, map.c, map.h, 5364 parse.c, parse.h, prompt.c, prompt.h, read.c, readline.c, 5365 readline.h, refresh.c, refresh.h, search.c, search.h, sig.c, 5366 sig.h, sys.h, term.c, term.h, tokenizer.c, tokenizer.h, tty.c, 5367 tty.h, vi.c: convert to new style guide, which includes: - ansi 5368 prototypes & features (such as stdargs) - 8 space indents 5369 53702000-08-29 09:04 lukem 5371 5372 * history.c: history_def_set has a `const int' as a third arg, not 5373 an `int'. picked up by the ultrix compiler, reported by simonb@ 5374 ... 5375 53762000-08-15 14:01 mrg 5377 5378 * Makefile: use .tmp temporaries for generated files, to avoid 5379 having failed generated output being used. 5380 53812000-08-02 15:45 chuck 5382 5383 * el.c: pull up 1.18 (approved by thorpej). allows a gdb linked 5384 with libedit's readline emulation to work properly with xxgdb. 5385 53862000-08-02 05:36 chuck 5387 5388 * el.c: make xxgdb and a gdb linked with libedit's readline 5389 emulation work properly together. xxgdb communicates with a gdb 5390 running on a pty that it sets to -echo,-onlcr prior to forking 5391 the gdb process. GNU readline preserves the -echo setting while 5392 libedit was undoing it (setting the tty to a sane state and 5393 totally confusing xxgdb's parser). 5394 5395 this diff simply disables libedit if both readline emulation and 5396 "stty -echo" are used/set. that is enough to make xxgdb work 5397 once again, but (XXX) this is not how GNU readline handles stty 5398 -echo (it does not echo anything, but editing commands like 5399 ^A,^K, etc. still work), so the readline emulation isn't 5400 perfect. 5401 5402 change reviewed by christos. 5403 54042000-06-29 18:09 he 5405 5406 * el.c: Pull up revision 1.17 (via patch, requested by sommerfeld): 5407 Only read .editrc from home directory. 5408 54092000-06-29 00:09 sommerfeld 5410 5411 * el.c: Pull up 1.17 (approved by thorpej): only look for .editrc 5412 in /d1/sommerfeld 5413 54142000-06-28 22:37 sommerfeld 5415 5416 * el.c: Only look in home directory for .editrc. (Discussed with 5417 Christos.) 5418 54192000-06-23 18:16 minoura 5420 5421 * term.c: Sync w/ netbsd-1-5-base. 5422 54232000-06-23 17:41 lukem 5424 5425 * editrc.5, makelist: Pull up editrc.5 revision 1.9 Pull up 5426 makelist revision 1.5 * add -m option to makelist, which 5427 generates an mdoc table with the key bindings and their 5428 descriptions * manually add the output of 'sh ./makelist -m 5429 vi.c ed.c common.c' to a new section in editrc(5) called 5430 `EDITOR COMMANDS' requested/approved by thorpej 5431 54322000-06-21 05:21 lukem 5433 5434 * editrc.5, makelist: * add -m option to makelist, which generates 5435 an mdoc table with the key bindings and their descriptions * 5436 manually add the output of 'sh ./makelist -m vi.c ed.c common.c' 5437 to a new section in editrc(5) called `EDITOR COMMANDS' 5438 54392000-06-02 15:37 lukem 5440 5441 * term.c: use strtol() (instead of atoi()) for sane error detection 5442 54432000-05-15 14:15 christos 5444 5445 * el.c: don't dump core on empty files. 5446 54472000-03-13 23:59 soren 5448 5449 * refresh.c: Fix doubled 'the's. 5450 54512000-03-10 14:06 jdolecek 5452 5453 * readline.c: Fix _rl_compat_sub() to really honour 'globally' flag 5454 instead of making the substitution always globally - affects 5455 _history_expand_command() and in turn history_expand() 5456 5457 All praise lint :) 5458 54592000-03-10 13:55 jdolecek 5460 5461 * readline.c: readline(): don't dereference NULL pointer if prompt 5462 is NULL history_tokenize(): avoid stepping too far if backslash 5463 is last character on the passed string update some comments 5464 5465 This makes gdb \ escaping work reliably and fixes lib/9511 by 5466 Assar Westerlund. 5467 54682000-03-10 13:25 jdolecek 5469 5470 * parse.c: include <stdlib.h> to get definition of malloc() and 5471 free(), so it's possible to compile this file separately when 5472 debugging 5473 54742000-02-28 18:41 chopps 5475 5476 * chared.c, editline.3, histedit.h: el_insertstr takes a "const 5477 char *" not "char *" now as it doesn't modify the argument. 5478 54792000-02-19 10:08 mycroft 5480 5481 * refresh.c, term.c: Fix refresh glitches when using auto-margin. 5482 54832000-01-20 23:56 christos 5484 5485 * refresh.c, term.c, term.h: Add support for automatic and magic 5486 margins (from tcsh) This makes the rightmost column usable on all 5487 programs that use editline. 5488 54892000-01-19 19:31 christos 5490 5491 * key.c: PR/9244: Kevin Schoedel: libedit dumps bindings 5492 inconsistently 5493 54942000-01-19 19:30 christos 5495 5496 * read.c: PR/9243: Kevin Schoedel: libedit ignores repeat count 5497 54981999-12-27 19:29 wrstuden 5499 5500 * editline.3, el.c, el.h, histedit.h, map.c, prompt.c, prompt.h, 5501 read.c, refresh.c, shlib_version, term.c, term.h, tty.h: Pull up 5502 to last week's -current. 5503 55041999-11-26 19:38 lukem 5505 5506 * editline.3: missing , 5507 55081999-11-13 12:32 lukem 5509 5510 * refresh.c: instead of using a private coord_t global variable to 5511 store the size of the rprompt, use the previously unused coord_t 5512 el->el_rprompt.p_pos 5513 55141999-11-12 02:05 lukem 5515 5516 * editline.3, el.c, el.h, histedit.h, prompt.c, prompt.h, 5517 refresh.c, shlib_version: - implement printing a right-side 5518 prompt. code derived from similar work I wrote for tcsh(1) 5519 three years ago. - implement EL_RPROMPT, which allows a 5520 setting/getting of a function which returns a string to be used 5521 as the right-side prompt. - improve HISTORY and AUTHORS sections 5522 in editline(3). - bump shlib minor version for EL_RPROMPT. 5523 5524 XXX: due to an implementation issue, the rprompt has a 1 space 5525 gap before the edge of the logical screen. editline's 5526 logical screen is 1 space less than the full screen width, 5527 so there's a 2 space gap between the rprompt and the right 5528 end of the physical screen. i'm not concerned about this. 5529 55301999-10-24 06:04 lukem 5531 5532 * term.c: Fix pointer arithmatic (caused problems on LP64, 5533 including ftp dumping core when `edit' was turned off then on). 5534 Problem solved by David Huggins-Daines <dhd@eradicator.org> 5535 55361999-10-15 19:01 jdolecek 5537 5538 * map.c, refresh.c: don't assume locales are not working - it may 5539 not be the case re_refresh(): cast the character passed to 5540 re_addc() to unsigned char, so we don't end up calling 5541 isprint() with negative value when chars are signed and 5542 character value is >= 128 5543 55441999-10-05 01:24 lukem 5545 5546 * term.c, term.h: update post change to return value of tputs() 5547 third argument 5548 55491999-10-05 01:23 lukem 5550 5551 * read.c: remove some lint 5552 55531999-09-26 16:37 lukem 5554 5555 * tty.h: apparantly need <unistd.h> for portable way of getting 5556 _POSIX_VDISABLE 5557 55581999-09-21 02:55 lukem 5559 5560 * el.c: * in el_source(): - don't reopen fp if it was 5561 successfully opened in a previous check - use 5562 strlcpy()/strlcat() instead of snprintf() to build a pathname, 5563 since the former are more portable to other systems than the 5564 latter * whitespace fascism 5565 55661999-09-21 02:07 lukem 5567 5568 * TEST/test.c: fix id header... 5569 55701999-09-21 01:43 lukem 5571 5572 * histedit.h: more whitespace fascism 5573 55741999-08-08 03:25 sommerfeld 5575 5576 * read.c: minor tweak to previous fix: don't spuriously truncate 5577 final newline under emacs. 5578 55791999-08-02 03:01 sommerfeld 5580 5581 * read.c, term.c, tty.c: Fix PR7685 (gdb under emacs prints 5582 spurious ^M and messes up terminal) plus a few bogons noted along 5583 the way: 1) Set EDIT_DISABLED if terminal type is emacs. 5584 2) fix bug in NO_TTY mode which caused it to not notice CR or LF 5585 3) implement EDIT_DISABLED within libedit to be somewhat 5586 like NO_TTY, except that a prompt is printed first. 5587 55881999-07-06 16:10 christos 5589 5590 * Makefile: Use LIBEDITDIR instead of CURDIR so we can use that 5591 Makefile to compile libedit from another directory. 5592 55931999-07-03 13:55 lukem 5594 5595 * readline.c: don't try to free() something allocated with alloca() 5596 in rl_complete_internal(). (noticed while using completion in 5597 gdb and getting inundated with warnings from the new free()) 5598 55991999-07-02 17:21 simonb 5600 5601 * Makefile, chared.c, chared.h, common.c, editline.3, editrc.5, 5602 el.c, emacs.c, hist.c, histedit.h, history.c, key.c, key.h, 5603 makelist, map.c, map.h, parse.c, parse.h, prompt.c, read.c, 5604 readline.c, refresh.c, search.c, search.h, sig.c, term.c, term.h, 5605 tokenizer.c, tokenizer.h, tty.c, tty.h, vi.c, TEST/test.c: More 5606 trailing white space. 5607 56081999-06-12 20:58 christos 5609 5610 * readline.c, refresh.c: Make this compile under linux 5611 56121999-03-22 20:45 garbled 5613 5614 * editline.3, editrc.5: Last of the .Os cleanups. .Os is defined 5615 in the tmac.doc-common file, so we shouldn't override it with 5616 versions in the manpages. Wheee! 5617 56181999-03-06 01:17 mycroft 5619 5620 * history.c: Add missing , in he_errlist[] initializer. Yay lint. 5621 56221999-03-04 12:45 itohy 5623 5624 * Makefile: Add minimal dependency to make "make depend" optional 5625 after cleandir. 5626 56271999-02-25 09:02 abs 5628 5629 * shlib_version: Add a note to update 5630 src/distrib/sets/lists/base/shl.*, and add a missing RCS Id. 5631 56321999-02-07 15:34 christos 5633 5634 * tty.c: PR/6957: Wolfgang Helbig: libedit swaps CR and LF control 5635 chars. 5636 56371999-02-05 21:53 christos 5638 5639 * chared.c, refresh.c, search.c, vi.c: delint. 5640 56411999-02-05 21:52 christos 5642 5643 * history.c: Encode the history lines using strvis() before saving 5644 it. Fixes gdb history problem with missing newlines. 5645 56461999-02-05 21:38 christos 5647 5648 * parse.c: M-X:<enter> core-dumped. 5649 56501999-01-11 23:40 kleink 5651 5652 * read.c: In userland, pull in <errno.h> instead of <sys/errno.h> 5653 for the declaration of errno. 5654 56551999-01-05 23:46 lukem 5656 5657 * editline.3: fix history() prototype. (d@openbsd.org) 5658 56591998-12-20 18:52 kleink 5660 5661 * histedit.h: Change multiple inclusion protection symbol name to 5662 NetBSD convention which doesn't violate namespace rules. 5663 56641998-12-12 21:08 christos 5665 5666 * chared.c, chared.h, common.c, el.c, key.c, map.c, parse.c, 5667 read.c, refresh.c, search.h, term.c, tokenizer.c, vi.c: delint 5668 56691998-12-12 20:54 christos 5670 5671 * readline.c: many problems; variables hidden by others, size_t <-> 5672 confusion 5673 56741998-12-12 20:52 christos 5675 5676 * history.c: - missing error message from array could cause core 5677 dump - delint 5678 56791998-12-03 18:51 cgd 5680 5681 * history.c: per e-mail with christos: history_next_event() should 5682 return -1, not NULL, in case of error, just like 5683 history_prev_event() does. 5684 56851998-09-28 13:00 christos 5686 5687 * el.c: fix core-dump caused by maps not being initialized before 5688 tty is called. 5689 56901998-09-27 20:04 christos 5691 5692 * tty.c: Obey incoming tty char settings. 5693 56941998-09-02 23:33 christos 5695 5696 * search.c: PR/6081: Wolfgang Helbig: search broken in vi mode. 5697 When patbuf was changed to be dynamically allocated, sizeof was 5698 not changed appropriately. 5699 57001998-07-29 04:26 lukem 5701 5702 * Makefile, editline.3, editrc.5, el.c, el.h, histedit.h, map.c, 5703 map.h, parse.c, prompt.c, prompt.h, shlib_version: * add more 5704 checks for NULL pointers in passed arguments * implement 5705 el_get(EditLine *, int op, void *result), which does the 5706 inverse of el_set() * add EL_EDITMODE operation to el_set and 5707 el_get; if non zero editing is enabled (the default). * add 5708 "edit on | off" editrc command, which modifies EL_EDITMODE. 5709 users can now add '*:edit off' in ~/.editrc as an advisory to 5710 disable editing. 5711 5712 NOTE: at this time EL_EDITMODE is just an indication of the state 5713 of the 'edit' command. It's up to the application to check this 5714 after el_source() or el_parse() to determine if editing is still 5715 required. 5716 57171998-06-08 12:56 lukem 5718 5719 * editline.3: documentation is always probably incomplete; don't 5720 make an issue of it 5721 57221998-06-01 16:31 lukem 5723 5724 * editline.3, histedit.h, read.c, shlib_version: * implement 5725 CC_REFRESH_BEEP; as per CC_REFRESH but beep as well. this is 5726 useful in completion when a partial completion is found * remove 5727 entry in BUGS about el_parse(); that was fixed a while ago 5728 57291998-05-20 03:38 christos 5730 5731 * TEST/test.c: Show the simpler way. 5732 57331998-05-20 03:37 christos 5734 5735 * editline.3, histedit.h, history.c: Add H_APPEND to simplify the 5736 interface. 5737 57381998-05-20 03:12 christos 5739 5740 * TEST/test.c: Fix for api changes. 5741 57421998-05-20 03:05 christos 5743 5744 * editline.3: Adjust for changes. 5745 57461998-05-20 03:04 christos 5747 5748 * tty.c, tty.h: change M_* constants to MD_* to avoid clashes with 5749 <stream.h> 5750 57511998-05-20 03:04 christos 5752 5753 * term.c, term.h: remove term_beep hack. 5754 57551998-05-20 03:03 christos 5756 5757 * shlib_version: Bump! 5758 57591998-05-20 03:03 christos 5760 5761 * readline.c: Adjust to the libedit api changes. 5762 57631998-05-20 03:02 christos 5764 5765 * history.c: Add a function to be able to set the cursor to a given 5766 event number. 5767 57681998-05-20 03:02 christos 5769 5770 * histedit.h: - add extra argument to el_init - fix history 5771 functions - add el_beep() 5772 57731998-05-20 03:01 christos 5774 5775 * emacs.c, refresh.c: cast is*() arg to unsigned char 5776 57771998-05-20 03:01 christos 5778 5779 * el.c: el_init takes a third stream argument and add el_beep. 5780 57811998-05-20 03:00 christos 5782 5783 * common.c: Don't print to stderr, but to the editline error 5784 stream. 5785 57861998-03-30 03:30 mrg 5787 5788 * map.c, tty.c: use int rather than char as an array index. 5789 57901998-02-05 19:51 perry 5791 5792 * editline.3: add LIBRARY section to man page 5793 57941998-02-03 20:12 perry 5795 5796 * chared.c, common.c, emacs.c, map.c, vi.c: remove obsolete 5797 register declarations 5798 57991998-01-30 03:27 perry 5800 5801 * term.c: update to lite-2 (just an sccsid change) 5802 58031998-01-30 03:18 perry 5804 5805 * term.c: import lite-2 5806 58071998-01-21 12:12 lukem 5808 5809 * editline.3, parse.c: in el_parse(), use a temporary buffer to 5810 store the program name when comparing, preventing trashing of 5811 argv[0]. remove note in man page warning of former behaviour. 5812 58131998-01-21 11:12 lukem 5814 5815 * read.c: fix compile errors if FIONREAD is defined. noted by 5816 David Holland <dholland@bordeaux.eecs.harvard.edu> in [bin/4012]. 5817 58181998-01-05 08:41 perry 5819 5820 * shlib_version: RCSID Police. 5821 58221997-12-20 20:15 christos 5823 5824 * el.c, el.h, read.c: Small optimization. Don't call isatty() on 5825 every invocation of el_gets, but remember if the tty setup 5826 failed... Also trim the input line of trailing \r's. 5827 58281997-11-13 05:48 thorpej 5829 5830 * term.c, term.h: Un-"protect" term_beep() and rename it to 5831 __term_beep() to keep it out of the user's namespace. We need to 5832 do this because the readline emulation functions call 5833 term_beep(), but readline isn't built using the same (funky) 5834 namespace-protection method as the rest of libedit (it's included 5835 like a normal library object). 5836 5837 Without this (fairly disgusting) hack, any program linked against 5838 libedit will fail to link with an unresolved reference to 5839 term_beep() if using an Elf toolchain (e.g. on the Alpha). 5840 5841 XXX Why this doesn't happen with NetBSD's a.out toolchain is a 5842 mystery XXX to me, and I'm not sure I really want to know (given 5843 that a.out XXX _should_ break the same way as Elf does in this 5844 case). 5845 58461997-11-13 05:43 thorpej 5847 5848 * Makefile: Build readline.o into debugging versions of libedit, 5849 too. 5850 58511997-11-12 22:56 thorpej 5852 5853 * readline.c: el_gets() takes an int *, not a size_t *. 5854 58551997-11-09 01:53 lukem 5856 5857 * Makefile: sync trunk's CPPFLAGS fix (approved by thorpej) 5858 58591997-11-09 01:13 lukem 5860 5861 * editline.3: move description of history() return value 5862 58631997-10-26 21:19 christos 5864 5865 * read.c: Make el_gets() work when the input is not a tty. 5866 58671997-10-26 21:17 christos 5868 5869 * Makefile: Make a link for history.h -> readline.h 5870 58711997-10-24 00:51 christos 5872 5873 * readline.c, readline.h: Const de-poisoning :-( Unfortunately the 5874 default gnu readline does not have full prototypes... With those 5875 changes, and a single line change in gdb/top.c, gdb links with 5876 -ledit 5877 58781997-10-24 00:24 christos 5879 5880 * Makefile, readline.c, readline.h, shlib_version: PR/4301: Jaromir 5881 Dolecek. Add gnu-readline wrapper for editline. 5882 58831997-10-23 08:35 lukem 5884 5885 * TEST/test.c: make this compile with the new libedit history() 5886 58871997-10-23 05:26 lukem 5888 5889 * Makefile: use CPPFLAGS instead of CFLAGS, fix building of test 5890 58911997-10-20 10:07 scottr 5892 5893 * tty.c: Add support for DTR/CTS flow control, from Bill 5894 Studenmund. 5895 58961997-10-14 17:05 christos 5897 5898 * editline.3, hist.c, hist.h, histedit.h, history.c, shlib_version: 5899 PR/4257: Jaromir Dolecek: history() has no generic error handling 5900 and isn't reentrant. This changes the interface of the history 5901 function, so we need a major number bump. 5902 59031997-10-13 18:09 lukem 5904 5905 * term.c: use <termcap.h> instead of "termcap.h" (which was 5906 repository copied to libterm) 5907 59081997-10-13 17:46 mrg 5909 5910 * termcap.h: termcap.h moves to libterm. 5911 59121997-10-09 21:16 christos 5913 5914 * tty.c: PR/4211: Dave Huang: don't lose VSTATUS and VEOL and any 5915 other characters that are VDISABLED by default. 5916 59171997-10-09 16:36 lukem 5918 5919 * Makefile: - define WARNS?=1 in the top-level Makefile.inc, and 5920 don't define anywhere else. - for now, override WARNS=0 in 5921 librpcsvc and libwrap, until they're cleaned up - rcsid police 5922 5923 lib is now clean (except for librpcsvc and libwrap) on the i386, 5924 and this should motivate the other ports to fix any other minor 5925 problems that their compilers pick up that the i386 version 5926 doesn't. 5927 59281997-07-31 01:57 jtc 5929 5930 * editline.3, editrc.5: Fix files using old TNF copyright notice 5931 59321997-07-06 20:25 christos 5933 5934 * Makefile, chared.c, common.c, el.c, emacs.c, hist.c, history.c, 5935 key.c, map.c, parse.c, prompt.c, read.c, refresh.c, search.c, 5936 sig.c, term.c, tokenizer.c, tty.c, vi.c: Fix compiler warnings. 5937 59381997-05-09 09:50 mycroft 5939 5940 * Makefile: Eliminate bogus redefinitions of standard targets. 5941 59421997-04-24 22:20 christos 5943 5944 * editrc.5: editrc -> editline 5945 59461997-04-24 20:54 christos 5947 5948 * el.c: Handle properly the case where the last line in the sourced 5949 file does not have a trailing '\n'. From Jeffrey C Honig. 5950 59511997-04-12 00:40 christos 5952 5953 * term.c: Return -1 if the terminal set operation resulted in dumb 5954 terminal settings. 5955 59561997-04-11 23:38 christos 5957 5958 * tty.h: Don't allow CSWTCH to interfere with CSUSP on __SVR4 5959 systems. 5960 59611997-04-11 19:52 christos 5962 5963 * el.c, histedit.h, history.c, read.c, sig.c, tty.c, tty.h: 5964 Portability fixes: __const -> const BADSIG -> 5965 SIG_ERR int flags -> u_int flags #if __STDC__ -> #ifdef 5966 __STDC__ 5967 59681997-03-24 23:11 christos 5969 5970 * Makefile: Makefile cleanups: use INCS variable to install 5971 includes and FILES to install objects. 5972 59731997-03-20 17:42 christos 5974 5975 * el.c: Fix potential stack overflow; from Keith Bostic. 5976 59771997-01-23 15:02 mrg 5978 5979 * history.c, search.c, term.c: - convert unsafe strcpy(), strcat() 5980 and sprintf() to the `n' versions. - some KNF. 5981 59821997-01-17 02:03 lukem 5983 5984 * el.c: fix el_source() - a block needed braces around it (the 5985 indenting fooled me) 5986 59871997-01-14 05:17 lukem 5988 5989 * common.c, editline.3, histedit.h, read.c: Implement CC_REDISPLAY, 5990 which (unlink CC_REFRESH) redraws the entire input line (a la 5991 ^R). This is useful if the binding outputs information and mucks 5992 up the input line. To be used in ``list-choices'' bindings (refer 5993 to the ^D binding in csh when filec is set) 5994 59951997-01-11 10:57 lukem 5996 5997 * editrc.5, parse.c: * document ^char and \ escape sequences * when 5998 parsing ^char control chars, check the correct char when 5999 determining validity (previously, ^char was a NOP interpreted 6000 as the literal string because of this bug) 6001 60021997-01-11 07:47 lukem 6003 6004 * Makefile, chared.c, chared.h, common.c, editline.3, editrc.5, 6005 el.c, el.h, emacs.c, hist.c, hist.h, histedit.h, history.c, 6006 key.c, key.h, makelist, map.c, map.h, parse.c, parse.h, prompt.c, 6007 prompt.h, read.c, refresh.c, refresh.h, search.c, search.h, 6008 sig.c, sig.h, sys.h, term.c, term.h, termcap.h, tokenizer.c, 6009 tokenizer.h, tty.c, tty.h, vi.c, TEST/test.c: RCSid police 6010 editline first appeared in 4.4BSD not NetBSD1.0 6011 60121997-01-11 07:26 lukem 6013 6014 * editline.3, parse.c: * in el_parse(), don't reference argv[0] if 6015 argc < 1 (return -1 instead) * clarify return value of el_parse() 6016 60171997-01-09 14:12 lukem 6018 6019 * Makefile, editline.3, editrc.5, parse.c: * add a man page for the 6020 editline routines * add a man page describing editrc * fix bugs 6021 in el_parse(): * didn't execute command when program name 6022 matched (test reversed) * was checking against empty string 6023 instead of program name * after checks, command to run also 6024 pointed to empty string 6025 6026 [christos - the author of libedit - ok-ed the man pages in 6027 general (which I wrote from scratch by RTFS) as well as the 6028 bugfix] 6029 60301996-10-18 07:45 thorpej 6031 6032 * Makefile: Use ${INSTALL}. 6033 60341996-06-01 21:59 jtk 6035 6036 * Makefile: merge bugfix from 1.2 branch: use includes target for 6037 include files 6038 60391996-06-01 21:58 jtk 6040 6041 * Makefile: use includes target to install include files 6042 60431995-10-15 20:42 christos 6044 6045 * hist.h, histedit.h, history.c, TEST/test.c: Added history load 6046 and save to file functions. 6047 60481995-06-07 07:52 cgd 6049 6050 * makelist: be a bit more careful when splitting pathnames 6051 60521995-04-29 22:44 christos 6053 6054 * term.c, term.h: Fixed the key mapping code and reverted Charles' 6055 changes. 6056 60571995-04-27 06:49 mycroft 6058 6059 * term.c, term.h: Remove dead code that can't possibly work. 6060 60611995-04-27 05:59 mycroft 6062 6063 * map.c: Trivial code ordering change. 6064 60651994-10-07 12:41 mycroft 6066 6067 * search.c, sys.h, term.c: Update from trunk. 6068 60691994-10-07 12:40 mycroft 6070 6071 * term.c: Fix typo. 6072 60731994-10-02 05:27 mycroft 6074 6075 * term.c: Don't even *try* to print out the name of the termcap 6076 file; it's hidden in libtermcap, and it normally uses the DB file 6077 anyway. 6078 60791994-10-02 05:23 mycroft 6080 6081 * term.c: Nuke bogus baud rate conversion code. 6082 60831994-10-02 03:10 jtc 6084 6085 * search.c, sys.h: Added code so that POSIX.2 regular expresion 6086 functions are used if REGEX is defined, V8 regular expresion 6087 functions are used if REGEXP is defined, and BSD regular 6088 expression functions are used if neither are defined. And 6089 defined REGEX in sys.h so that programs using libedit don't have 6090 to link with libcompat. 6091 60921994-08-30 18:33 cgd 6093 6094 * emacs.c: from trunk; pr 420 6095 60961994-08-30 17:16 cgd 6097 6098 * emacs.c: fix for pr 420, from Christos. 6099 61001994-05-06 08:17 cgd 6101 6102 * Makefile, shlib_version: local 6103 61041994-05-06 08:01 cgd 6105 6106 * Makefile, termcap.h, tokenizer.c, tokenizer.h, tty.c, tty.h, 6107 vi.c, read.c, refresh.c, refresh.h, search.c, search.h, sig.c, 6108 sig.h, sys.h, term.c, term.h, history.c, key.c, key.h, map.c, 6109 map.h, parse.c, parse.h, prompt.c, prompt.h, chared.c, chared.h, 6110 common.c, el.c, el.h, emacs.c, hist.c, hist.h, histedit.h, 6111 makelist, TEST/test.c: libedit! 6112 61131994-05-06 08:01 cgd 6114 6115 * Makefile, termcap.h, tokenizer.c, tokenizer.h, tty.c, tty.h, 6116 vi.c, read.c, refresh.c, refresh.h, search.c, search.h, sig.c, 6117 sig.h, sys.h, term.c, term.h, history.c, key.c, key.h, map.c, 6118 map.h, parse.c, parse.h, prompt.c, prompt.h, chared.c, chared.h, 6119 common.c, el.c, el.h, emacs.c, hist.c, hist.h, histedit.h, 6120 makelist, TEST/test.c: Initial revision 6121 6122