View | Details | Raw Unified | Return to bug 169773 | Differences between
and this patch

Collapse All | Expand All

(-)b/lib/libedit/editline.3 (+20 lines)
Lines 385-390 check this Link Here
385
(using
385
(using
386
.Fn el_get )
386
.Fn el_get )
387
to determine if editing should be enabled or not.
387
to determine if editing should be enabled or not.
388
.It Dv EL_RESTART_READ , Fa "int flag"
389
If
390
.Fa flag
391
is not zero (as per default),
392
then
393
.Fn el_getc
394
and
395
.Fn el_gets
396
will restart character reads that failed with
397
.Dv EINTR
398
errors.
399
Note this may be restricted to the builtin character read function
400
.Dv EL_BUILTIN_GETCFN
401
(see
402
.Dv EL_GETCFN
403
below).
388
.It Dv EL_GETCFN , Fa "int (*f)(EditLine *, char *c)"
404
.It Dv EL_GETCFN , Fa "int (*f)(EditLine *, char *c)"
389
Define the character reading function as
405
Define the character reading function as
390
.Fa f ,
406
.Fa f ,
Lines 486-491 Retrieve Link Here
486
previously registered with the corresponding
502
previously registered with the corresponding
487
.Fn el_set
503
.Fn el_set
488
call.
504
call.
505
.It Dv EL_RESTART_READ , Fa "int"
506
Return non-zero if reading of characters is automatically restarted for
507
.Dv EINTR
508
errors.
489
.It Dv EL_UNBUFFERED , Fa "int"
509
.It Dv EL_UNBUFFERED , Fa "int"
490
Sets or clears unbuffered mode.
510
Sets or clears unbuffered mode.
491
In this mode,
511
In this mode,
(-)b/lib/libedit/el.c (+12 lines)
Lines 274-279 el_set(EditLine *el, int op, ...) Link Here
274
		el->el_data = va_arg(ap, void *);
274
		el->el_data = va_arg(ap, void *);
275
		break;
275
		break;
276
276
277
	case EL_RESTART_READ:
278
		if (va_arg(ap, int))
279
			el->el_flags |= RESTART_READ;
280
		else
281
			el->el_flags &= ~RESTART_READ;
282
		break;
283
277
	case EL_UNBUFFERED:
284
	case EL_UNBUFFERED:
278
		rv = va_arg(ap, int);
285
		rv = va_arg(ap, int);
279
		if (rv && !(el->el_flags & UNBUFFERED)) {
286
		if (rv && !(el->el_flags & UNBUFFERED)) {
Lines 435-440 el_get(EditLine *el, int op, ...) Link Here
435
		rv = 0;
442
		rv = 0;
436
		break;
443
		break;
437
444
445
	case EL_RESTART_READ:
446
		*va_arg(ap, int *) = ((el->el_flags & RESTART_READ) != 0);
447
		rv = 0;
448
		break;
449
438
	case EL_UNBUFFERED:
450
	case EL_UNBUFFERED:
439
		*va_arg(ap, int *) = (!(el->el_flags & UNBUFFERED));
451
		*va_arg(ap, int *) = (!(el->el_flags & UNBUFFERED));
440
		rv = 0;
452
		rv = 0;
(-)b/lib/libedit/el.h (+1 lines)
Lines 55-60 Link Here
55
#define	NO_TTY		0x02
55
#define	NO_TTY		0x02
56
#define	EDIT_DISABLED	0x04
56
#define	EDIT_DISABLED	0x04
57
#define	UNBUFFERED	0x08
57
#define	UNBUFFERED	0x08
58
#define RESTART_READ	0x100
58
59
59
typedef int bool_t;			/* True or not			*/
60
typedef int bool_t;			/* True or not			*/
60
61
(-)b/lib/libedit/histedit.h (+1 lines)
Lines 139-144 unsigned char _el_fn_sh_complete(EditLine *, int); Link Here
139
#define	EL_PROMPT_ESC	21	/* , prompt_func, Char);	      set/get */
139
#define	EL_PROMPT_ESC	21	/* , prompt_func, Char);	      set/get */
140
#define	EL_RPROMPT_ESC	22	/* , prompt_func, Char);	      set/get */
140
#define	EL_RPROMPT_ESC	22	/* , prompt_func, Char);	      set/get */
141
#define	EL_RESIZE	23	/* , el_zfunc_t, void *);	      set     */
141
#define	EL_RESIZE	23	/* , el_zfunc_t, void *);	      set     */
142
#define	EL_RESTART_READ	24	/* , int);			      set/get */
142
143
143
#define	EL_BUILTIN_GETCFN	(NULL)
144
#define	EL_BUILTIN_GETCFN	(NULL)
144
145
(-)b/lib/libedit/read.c (-1 / +2 lines)
Lines 304-309 read_char(EditLine *el, char *cp) Link Here
304
			el_set(el, EL_REFRESH);
304
			el_set(el, EL_REFRESH);
305
			goto again;
305
			goto again;
306
		}
306
		}
307
		if (e == EINTR && (el->el_flags & RESTART_READ))
308
			goto again;
307
		if (!tried && read__fixio(el->el_infd, e) == 0)
309
		if (!tried && read__fixio(el->el_infd, e) == 0)
308
			tried = 1;
310
			tried = 1;
309
		else {
311
		else {
310
- 

Return to bug 169773