remove trailing whitespace
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
NOTE: this was taken from the GNU Readline documentation and ported
|
||||
to libedit. A commad to output the history list was added.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -453,7 +453,7 @@ com_pwd (char* ignore)
|
||||
|
||||
/* The user wishes to quit using this program. Just set DONE
|
||||
non-zero. */
|
||||
int
|
||||
int
|
||||
com_quit (char *arg)
|
||||
{
|
||||
done = 1;
|
||||
|
@@ -577,7 +577,7 @@ ch_enlargebufs(EditLine *el, size_t addlen)
|
||||
|
||||
/* zero the newly added memory, leave old data in */
|
||||
(void) memset(&newbuffer[sz], 0, (newsz - sz) * sizeof(*newbuffer));
|
||||
|
||||
|
||||
oldbuf = el->el_line.buffer;
|
||||
|
||||
el->el_line.buffer = newbuffer;
|
||||
@@ -625,7 +625,7 @@ ch_enlargebufs(EditLine *el, size_t addlen)
|
||||
el->el_chared.c_redo.lim = newbuffer +
|
||||
(el->el_chared.c_redo.lim - el->el_chared.c_redo.buf);
|
||||
el->el_chared.c_redo.buf = newbuffer;
|
||||
|
||||
|
||||
if (!hist_enlargebuf(el, sz, newsz))
|
||||
return 0;
|
||||
|
||||
|
@@ -57,7 +57,7 @@ ct_conv_buff_resize(ct_buffer_t *conv, size_t mincsize, size_t minwsize)
|
||||
conv->csize = 0;
|
||||
el_free(conv->cbuff);
|
||||
conv->cbuff = NULL;
|
||||
} else
|
||||
} else
|
||||
conv->cbuff = p;
|
||||
}
|
||||
|
||||
|
@@ -114,9 +114,9 @@ wchar_t *wcsdup(const wchar_t *s);
|
||||
#else /* NARROW */
|
||||
|
||||
#define ct_mbtowc error
|
||||
#define ct_mbtowc_reset
|
||||
#define ct_mbtowc_reset
|
||||
#define ct_wctomb error
|
||||
#define ct_wctomb_reset
|
||||
#define ct_wctomb_reset
|
||||
#define ct_wcstombs(a, b, c) (strncpy(a, b, c), strlen(a))
|
||||
#define ct_mbstowcs(a, b, c) (strncpy(a, b, c), strlen(a))
|
||||
|
||||
@@ -213,7 +213,7 @@ protected size_t ct_enc_width(Char);
|
||||
#define VISUAL_WIDTH_MAX 8
|
||||
|
||||
/* The terminal is thought of in terms of X columns by Y lines. In the cases
|
||||
* where a wide character takes up more than one column, the adjacent
|
||||
* where a wide character takes up more than one column, the adjacent
|
||||
* occupied column entries will contain this faux character. */
|
||||
#define MB_FILL_CHAR ((Char)-1)
|
||||
|
||||
|
@@ -449,7 +449,7 @@ ed_unassigned(EditLine *el, Int c __attribute__((__unused__)))
|
||||
*/
|
||||
protected el_action_t
|
||||
/*ARGSUSED*/
|
||||
ed_tty_sigint(EditLine *el __attribute__((__unused__)),
|
||||
ed_tty_sigint(EditLine *el __attribute__((__unused__)),
|
||||
Int c __attribute__((__unused__)))
|
||||
{
|
||||
|
||||
@@ -463,7 +463,7 @@ ed_tty_sigint(EditLine *el __attribute__((__unused__)),
|
||||
*/
|
||||
protected el_action_t
|
||||
/*ARGSUSED*/
|
||||
ed_tty_dsusp(EditLine *el __attribute__((__unused__)),
|
||||
ed_tty_dsusp(EditLine *el __attribute__((__unused__)),
|
||||
Int c __attribute__((__unused__)))
|
||||
{
|
||||
|
||||
@@ -477,7 +477,7 @@ ed_tty_dsusp(EditLine *el __attribute__((__unused__)),
|
||||
*/
|
||||
protected el_action_t
|
||||
/*ARGSUSED*/
|
||||
ed_tty_flush_output(EditLine *el __attribute__((__unused__)),
|
||||
ed_tty_flush_output(EditLine *el __attribute__((__unused__)),
|
||||
Int c __attribute__((__unused__)))
|
||||
{
|
||||
|
||||
@@ -491,7 +491,7 @@ ed_tty_flush_output(EditLine *el __attribute__((__unused__)),
|
||||
*/
|
||||
protected el_action_t
|
||||
/*ARGSUSED*/
|
||||
ed_tty_sigquit(EditLine *el __attribute__((__unused__)),
|
||||
ed_tty_sigquit(EditLine *el __attribute__((__unused__)),
|
||||
Int c __attribute__((__unused__)))
|
||||
{
|
||||
|
||||
@@ -505,7 +505,7 @@ ed_tty_sigquit(EditLine *el __attribute__((__unused__)),
|
||||
*/
|
||||
protected el_action_t
|
||||
/*ARGSUSED*/
|
||||
ed_tty_sigtstp(EditLine *el __attribute__((__unused__)),
|
||||
ed_tty_sigtstp(EditLine *el __attribute__((__unused__)),
|
||||
Int c __attribute__((__unused__)))
|
||||
{
|
||||
|
||||
@@ -519,7 +519,7 @@ ed_tty_sigtstp(EditLine *el __attribute__((__unused__)),
|
||||
*/
|
||||
protected el_action_t
|
||||
/*ARGSUSED*/
|
||||
ed_tty_stop_output(EditLine *el __attribute__((__unused__)),
|
||||
ed_tty_stop_output(EditLine *el __attribute__((__unused__)),
|
||||
Int c __attribute__((__unused__)))
|
||||
{
|
||||
|
||||
@@ -533,7 +533,7 @@ ed_tty_stop_output(EditLine *el __attribute__((__unused__)),
|
||||
*/
|
||||
protected el_action_t
|
||||
/*ARGSUSED*/
|
||||
ed_tty_start_output(EditLine *el __attribute__((__unused__)),
|
||||
ed_tty_start_output(EditLine *el __attribute__((__unused__)),
|
||||
Int c __attribute__((__unused__)))
|
||||
{
|
||||
|
||||
@@ -598,7 +598,7 @@ ed_clear_screen(EditLine *el, Int c __attribute__((__unused__)))
|
||||
*/
|
||||
protected el_action_t
|
||||
/*ARGSUSED*/
|
||||
ed_redisplay(EditLine *el __attribute__((__unused__)),
|
||||
ed_redisplay(EditLine *el __attribute__((__unused__)),
|
||||
Int c __attribute__((__unused__)))
|
||||
{
|
||||
|
||||
@@ -626,7 +626,7 @@ ed_start_over(EditLine *el, Int c __attribute__((__unused__)))
|
||||
*/
|
||||
protected el_action_t
|
||||
/*ARGSUSED*/
|
||||
ed_sequence_lead_in(EditLine *el __attribute__((__unused__)),
|
||||
ed_sequence_lead_in(EditLine *el __attribute__((__unused__)),
|
||||
Int c __attribute__((__unused__)))
|
||||
{
|
||||
|
||||
@@ -660,7 +660,7 @@ ed_prev_history(EditLine *el, Int c __attribute__((__unused__)))
|
||||
if (hist_get(el) == CC_ERROR) {
|
||||
if (el->el_map.type == MAP_VI) {
|
||||
el->el_history.eventno = sv_event;
|
||||
|
||||
|
||||
}
|
||||
beep = 1;
|
||||
/* el->el_history.eventno was fixed by first call */
|
||||
|
@@ -97,7 +97,7 @@ typedef KEYMAP_ENTRY *Keymap;
|
||||
extern "C" {
|
||||
#endif
|
||||
extern const char *rl_library_version;
|
||||
extern int rl_readline_version;
|
||||
extern int rl_readline_version;
|
||||
extern char *rl_readline_name;
|
||||
extern FILE *rl_instream;
|
||||
extern FILE *rl_outstream;
|
||||
|
@@ -472,7 +472,7 @@ fn_complete(EditLine *el,
|
||||
(int)(cur_off - len), cur_off);
|
||||
} else
|
||||
matches = 0;
|
||||
if (!attempted_completion_function ||
|
||||
if (!attempted_completion_function ||
|
||||
(over != NULL && !*over && !matches))
|
||||
matches = completion_matches(ct_encode_string(temp, &el->el_scratch), complet_func);
|
||||
|
||||
@@ -520,7 +520,7 @@ fn_complete(EditLine *el,
|
||||
}
|
||||
/* matches[1] through matches[i-1] are available */
|
||||
matches_num = i - 1;
|
||||
|
||||
|
||||
/* newline to get on next line from command line */
|
||||
(void)fprintf(el->el_outfile, "\n");
|
||||
|
||||
|
@@ -128,7 +128,7 @@ unsigned char _el_fn_complete(EditLine *, int);
|
||||
* For operations that support set or set/get, the argument types listed are for
|
||||
* the "set" operation. For "get", each listed type must be a pointer.
|
||||
* E.g. EL_EDITMODE takes an int when set, but an int* when get.
|
||||
*
|
||||
*
|
||||
* Operations that only support "get" have the correct argument types listed.
|
||||
*/
|
||||
#define EL_PROMPT 0 /* , prompt_func); set/get */
|
||||
|
@@ -439,7 +439,7 @@ history_def_del(ptr_t p, TYPE(HistEvent) *ev __attribute__((__unused__)),
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
private void
|
||||
history_def_delete(history_t *h,
|
||||
history_def_delete(history_t *h,
|
||||
TYPE(HistEvent) *ev __attribute__((__unused__)), hentry_t *hp)
|
||||
{
|
||||
HistEventPrivate *evp = (void *)&hp->ev;
|
||||
@@ -498,7 +498,7 @@ history_def_enter(ptr_t p, TYPE(HistEvent) *ev, const Char *str)
|
||||
|
||||
if ((h->flags & H_UNIQUE) != 0 && h->list.next != &h->list &&
|
||||
Strcmp(h->list.next->ev.str, str) == 0)
|
||||
return (0);
|
||||
return (0);
|
||||
|
||||
if (history_def_insert(h, ev, str) == -1)
|
||||
return (-1); /* error, keep error message */
|
||||
|
@@ -587,7 +587,7 @@ key_kprint(EditLine *el, const Char *key, key_value_t *val, int ntype)
|
||||
case XK_STR:
|
||||
case XK_EXE:
|
||||
(void) key__decode_str(val->str, unparsbuf,
|
||||
sizeof(unparsbuf),
|
||||
sizeof(unparsbuf),
|
||||
ntype == XK_STR ? "\"\"" : "[]");
|
||||
(void) fprintf(el->el_outfile, fmt,
|
||||
ct_encode_string(key, &el->el_scratch), unparsbuf);
|
||||
|
@@ -1155,7 +1155,7 @@ map_print_some_keys(EditLine *el, el_action_t *map, Int first, Int last)
|
||||
lastbuf[1] = 0;
|
||||
if (map[first] == ED_UNASSIGNED) {
|
||||
if (first == last) {
|
||||
(void) key__decode_str(firstbuf, unparsbuf,
|
||||
(void) key__decode_str(firstbuf, unparsbuf,
|
||||
sizeof(unparsbuf), STRQQ);
|
||||
(void) fprintf(el->el_outfile,
|
||||
"%-15s-> is undefined\n", unparsbuf);
|
||||
@@ -1166,14 +1166,14 @@ map_print_some_keys(EditLine *el, el_action_t *map, Int first, Int last)
|
||||
for (bp = el->el_map.help; bp < ep; bp++) {
|
||||
if (bp->func == map[first]) {
|
||||
if (first == last) {
|
||||
(void) key__decode_str(firstbuf, unparsbuf,
|
||||
(void) key__decode_str(firstbuf, unparsbuf,
|
||||
sizeof(unparsbuf), STRQQ);
|
||||
(void) fprintf(el->el_outfile, "%-15s-> " FSTR "\n",
|
||||
unparsbuf, bp->name);
|
||||
} else {
|
||||
(void) key__decode_str(firstbuf, unparsbuf,
|
||||
(void) key__decode_str(firstbuf, unparsbuf,
|
||||
sizeof(unparsbuf), STRQQ);
|
||||
(void) key__decode_str(lastbuf, extrabuf,
|
||||
(void) key__decode_str(lastbuf, extrabuf,
|
||||
sizeof(extrabuf), STRQQ);
|
||||
(void) fprintf(el->el_outfile,
|
||||
"%-4s to %-7s-> " FSTR "\n",
|
||||
@@ -1184,14 +1184,14 @@ map_print_some_keys(EditLine *el, el_action_t *map, Int first, Int last)
|
||||
}
|
||||
#ifdef MAP_DEBUG
|
||||
if (map == el->el_map.key) {
|
||||
(void) key__decode_str(firstbuf, unparsbuf,
|
||||
(void) key__decode_str(firstbuf, unparsbuf,
|
||||
sizeof(unparsbuf), STRQQ);
|
||||
(void) fprintf(el->el_outfile,
|
||||
"BUG!!! %s isn't bound to anything.\n", unparsbuf);
|
||||
(void) fprintf(el->el_outfile, "el->el_map.key[%d] == %d\n",
|
||||
first, el->el_map.key[first]);
|
||||
} else {
|
||||
(void) key__decode_str(firstbuf, unparsbuf,
|
||||
(void) key__decode_str(firstbuf, unparsbuf,
|
||||
sizeof(unparsbuf), STRQQ);
|
||||
(void) fprintf(el->el_outfile,
|
||||
"BUG!!! %s isn't bound to anything.\n", unparsbuf);
|
||||
|
@@ -48,7 +48,7 @@ typedef struct el_prompt_t {
|
||||
el_pfunc_t p_func; /* Function to return the prompt */
|
||||
coord_t p_pos; /* position in the line after prompt */
|
||||
Char p_ignore; /* character to start/end literal */
|
||||
int p_wide;
|
||||
int p_wide;
|
||||
} el_prompt_t;
|
||||
|
||||
protected void prompt_print(EditLine *, int);
|
||||
|
@@ -40,7 +40,7 @@ typedef int (*el_rfunc_t)(EditLine *, Char *);
|
||||
typedef struct el_read_t {
|
||||
el_rfunc_t read_char; /* Function to read a character */
|
||||
} el_read_t;
|
||||
|
||||
|
||||
protected int read_init(EditLine *);
|
||||
protected void read_prepare(EditLine *);
|
||||
protected void read_finish(EditLine *);
|
||||
|
@@ -258,7 +258,7 @@ rl_set_prompt(const char *prompt)
|
||||
|
||||
if (!prompt)
|
||||
prompt = "";
|
||||
if (rl_prompt != NULL && strcmp(rl_prompt, prompt) == 0)
|
||||
if (rl_prompt != NULL && strcmp(rl_prompt, prompt) == 0)
|
||||
return 0;
|
||||
if (rl_prompt)
|
||||
free(rl_prompt);
|
||||
@@ -352,7 +352,7 @@ rl_initialize(void)
|
||||
"ReadLine compatible suspend function",
|
||||
_el_rl_tstp);
|
||||
el_set(e, EL_BIND, "^Z", "rl_tstp", NULL);
|
||||
|
||||
|
||||
/* read settings from configuration file */
|
||||
el_source(e, NULL);
|
||||
|
||||
@@ -1937,7 +1937,7 @@ rl_callback_read_char()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
rl_callback_handler_install(const char *prompt, VCPFunction *linefunc)
|
||||
{
|
||||
if (e == NULL) {
|
||||
@@ -1946,9 +1946,9 @@ rl_callback_handler_install(const char *prompt, VCPFunction *linefunc)
|
||||
(void)rl_set_prompt(prompt);
|
||||
rl_linefunc = linefunc;
|
||||
el_set(e, EL_UNBUFFERED, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
rl_callback_handler_remove(void)
|
||||
{
|
||||
el_set(e, EL_UNBUFFERED, 0);
|
||||
@@ -2148,7 +2148,7 @@ rl_completion_matches(const char *str, rl_compentry_func_t *fun)
|
||||
list[0][min] = '\0';
|
||||
}
|
||||
return list;
|
||||
|
||||
|
||||
out:
|
||||
free(list);
|
||||
return NULL;
|
||||
|
@@ -110,7 +110,7 @@ re_nextline(EditLine *el)
|
||||
for(i = 1; i < lins; i++)
|
||||
el->el_vdisplay[i - 1] = el->el_vdisplay[i];
|
||||
|
||||
firstline[0] = '\0'; /* empty the string */
|
||||
firstline[0] = '\0'; /* empty the string */
|
||||
el->el_vdisplay[i - 1] = firstline;
|
||||
} else
|
||||
el->el_refresh.r_cursor.v++;
|
||||
@@ -1077,7 +1077,7 @@ re_fastputc(EditLine *el, Int c)
|
||||
if (el->el_cursor.v + 1 >= el->el_term.t_size.v) {
|
||||
int i, lins = el->el_term.t_size.v;
|
||||
Char *firstline = el->el_display[0];
|
||||
|
||||
|
||||
for(i = 1; i < lins; i++)
|
||||
el->el_display[i - 1] = el->el_display[i];
|
||||
|
||||
|
@@ -61,7 +61,7 @@
|
||||
# define __END_DECLS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef public
|
||||
# define public /* Externally visible functions/variables */
|
||||
#endif
|
||||
|
@@ -648,7 +648,7 @@ mc_again:
|
||||
(el->el_cursor.h & 0370);
|
||||
i < (where & ~0x7);
|
||||
i += 8)
|
||||
term__putc(el, '\t');
|
||||
term__putc(el, '\t');
|
||||
/* then tab over */
|
||||
el->el_cursor.h = where & ~0x7;
|
||||
}
|
||||
@@ -1343,7 +1343,7 @@ term_writec(EditLine *el, Int c)
|
||||
*/
|
||||
protected int
|
||||
/*ARGSUSED*/
|
||||
term_telltc(EditLine *el, int argc __attribute__((__unused__)),
|
||||
term_telltc(EditLine *el, int argc __attribute__((__unused__)),
|
||||
const Char **argv __attribute__((__unused__)))
|
||||
{
|
||||
const struct termcapstr *t;
|
||||
|
@@ -315,7 +315,7 @@ unvis(char *cp, int c, int *astate, int flag)
|
||||
*astate = SS(0, S_META1);
|
||||
else if (c == '^')
|
||||
*astate = SS(0, S_CTRL);
|
||||
else
|
||||
else
|
||||
goto bad;
|
||||
return UNVIS_NOCHAR;
|
||||
|
||||
|
@@ -981,7 +981,7 @@ vi_to_history_line(EditLine *el, Int c)
|
||||
el->el_history.eventno = 1;
|
||||
if (hist_get(el) == CC_ERROR)
|
||||
return CC_ERROR;
|
||||
el->el_history.eventno = 1 + el->el_history.ev.num
|
||||
el->el_history.eventno = 1 + el->el_history.ev.num
|
||||
- el->el_state.argument;
|
||||
if (el->el_history.eventno < 0) {
|
||||
el->el_history.eventno = sv_event_no;
|
||||
|
@@ -149,7 +149,7 @@ do_mvis(char *dst, int c, int flag, int nextc, const char *extra)
|
||||
((isspace(c) && (nextc == '\r' || nextc == '\n')) ||
|
||||
/* Out of range */
|
||||
(!isspace(c) && (c < 33 || (c > 60 && c < 62) || c > 126)) ||
|
||||
/* Specific char to be escaped */
|
||||
/* Specific char to be escaped */
|
||||
strchr("#$@[\\]^`{|}~", c) != NULL)) {
|
||||
*dst++ = '=';
|
||||
*dst++ = XTOA(((unsigned int)c >> 4) & 0xf);
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee. Permission to modify the code and to distribute modified
|
||||
* code is also granted without any restrictions.
|
||||
*/
|
||||
@@ -15,9 +15,9 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: wcsdup.c,v 1.3 2008/05/26 13:17:48 haad Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: wcsdup.c,v 1.3 2008/05/26 13:17:48 haad Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
Reference in New Issue
Block a user