Update to 3.0 (20110802 snap), fixes #732989
This commit is contained in:
parent
9284484112
commit
1feeb90cf7
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
libedit-20110227-3.0.tar.gz
|
||||
/libedit-20110802-3.0.tar.gz
|
||||
|
@ -1,93 +0,0 @@
|
||||
diff -durp libedit-20110227-3.0.orig/examples/fileman.c libedit-20110227-3.0/examples/fileman.c
|
||||
--- libedit-20110227-3.0.orig/examples/fileman.c 2010-04-22 13:13:17.000000000 -0600
|
||||
+++ libedit-20110227-3.0/examples/fileman.c 2011-03-24 15:48:02.492809146 -0600
|
||||
@@ -279,7 +279,7 @@ command_generator (text, state)
|
||||
|
||||
/* Return the next name which partially matches from the
|
||||
command list. */
|
||||
- while (name = commands[list_index].name)
|
||||
+ while ((name = commands[list_index].name))
|
||||
{
|
||||
list_index++;
|
||||
|
||||
diff -durp libedit-20110227-3.0.orig/examples/wtc1.c libedit-20110227-3.0/examples/wtc1.c
|
||||
--- libedit-20110227-3.0.orig/examples/wtc1.c 2010-04-22 13:13:17.000000000 -0600
|
||||
+++ libedit-20110227-3.0/examples/wtc1.c 2011-03-24 15:48:02.493809075 -0600
|
||||
@@ -60,7 +60,7 @@ complete(EditLine *el, int ch)
|
||||
char *buf, *bptr;
|
||||
const LineInfoW *lf = el_wline(el);
|
||||
int len, mblen, i;
|
||||
- unsigned char res;
|
||||
+ unsigned char res = CC_NORM;
|
||||
|
||||
/* Find the last word */
|
||||
for (ptr = lf->cursor -1; !iswspace(*ptr) && ptr > lf->buffer; --ptr)
|
||||
diff -durp libedit-20110227-3.0.orig/src/readline.c libedit-20110227-3.0/src/readline.c
|
||||
--- libedit-20110227-3.0.orig/src/readline.c 2011-02-26 15:42:59.000000000 -0700
|
||||
+++ libedit-20110227-3.0/src/readline.c 2011-03-24 15:48:02.500808588 -0600
|
||||
@@ -1280,8 +1280,8 @@ history_truncate_file (const char *filen
|
||||
}
|
||||
}
|
||||
fflush(fp);
|
||||
- if((off = ftello(fp)) > 0)
|
||||
- (void)ftruncate(fileno(fp), off);
|
||||
+ if((off = ftello(fp)) > 0 && ftruncate(fileno(fp), off) < 0)
|
||||
+ ret = errno;
|
||||
out3:
|
||||
fclose(tp);
|
||||
out2:
|
||||
diff -durp libedit-20110227-3.0.orig/src/vi.c libedit-20110227-3.0/src/vi.c
|
||||
--- libedit-20110227-3.0.orig/src/vi.c 2011-02-26 15:42:59.000000000 -0700
|
||||
+++ libedit-20110227-3.0/src/vi.c 2011-03-24 15:48:02.501808516 -0600
|
||||
@@ -1009,6 +1009,7 @@ vi_histedit(EditLine *el, Int c)
|
||||
char *cp;
|
||||
size_t len;
|
||||
Char *line;
|
||||
+ el_action_t rv = CC_ERROR;
|
||||
|
||||
if (el->el_state.doingarg) {
|
||||
if (vi_to_history_line(el, 0) == CC_ERROR)
|
||||
@@ -1036,16 +1037,14 @@ vi_histedit(EditLine *el, Int c)
|
||||
ct_wcstombs(cp, line, TMP_BUFSIZ - 1);
|
||||
cp[TMP_BUFSIZ - 1] = '\0';
|
||||
len = strlen(cp);
|
||||
- write(fd, cp, len);
|
||||
- write(fd, "\n", 1);
|
||||
+ if (write(fd, cp, len) < 0 || write(fd, "\n", 1) < 0)
|
||||
+ /* FIXME: handle EAGAIN somehow? */
|
||||
+ goto fail;
|
||||
+
|
||||
pid = fork();
|
||||
switch (pid) {
|
||||
case -1:
|
||||
- close(fd);
|
||||
- unlink(tempfile);
|
||||
- el_free(cp);
|
||||
- el_free(line);
|
||||
- return CC_ERROR;
|
||||
+ goto fail;
|
||||
case 0:
|
||||
close(fd);
|
||||
execlp("vi", "vi", tempfile, (char *)NULL);
|
||||
@@ -1067,15 +1066,17 @@ vi_histedit(EditLine *el, Int c)
|
||||
len = 0;
|
||||
el->el_line.cursor = el->el_line.buffer;
|
||||
el->el_line.lastchar = el->el_line.buffer + len;
|
||||
- el_free(cp);
|
||||
- el_free(line);
|
||||
break;
|
||||
}
|
||||
|
||||
+ /* return CC_REFRESH; */
|
||||
+ rv = ed_newline(el, 0);
|
||||
+fail:
|
||||
close(fd);
|
||||
unlink(tempfile);
|
||||
- /* return CC_REFRESH; */
|
||||
- return ed_newline(el, 0);
|
||||
+ el_free(cp);
|
||||
+ el_free(line);
|
||||
+ return rv;
|
||||
}
|
||||
|
||||
/* vi_history_word():
|
@ -1,4 +1,4 @@
|
||||
%define snap 20110227
|
||||
%define snap 20110802
|
||||
|
||||
Summary: The NetBSD Editline library
|
||||
Name: libedit
|
||||
@ -9,9 +9,6 @@ Group: System Environment/Libraries
|
||||
URL: http://www.thrysoee.dk/editline/
|
||||
Source0: http://www.thrysoee.dk/editline/%{name}-%{snap}-%{version}.tar.gz
|
||||
|
||||
# eliminate compile-time warnings
|
||||
Patch0: libedit-3.0-warnings.patch
|
||||
|
||||
BuildRequires: ncurses-devel
|
||||
|
||||
%description
|
||||
@ -32,7 +29,6 @@ This package contains development files for %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{snap}-%{version}
|
||||
%patch0 -p1
|
||||
|
||||
# Suppress rpmlint error.
|
||||
iconv -f ISO8859-1 -t UTF-8 -o ChangeLog.utf-8 ChangeLog
|
||||
@ -78,6 +74,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_includedir}/editline/readline.h
|
||||
|
||||
%changelog
|
||||
* Fri Aug 26 2011 Kamil Dudka <kdudka@redhat.com> 3.0-3.20110802cvs
|
||||
- Update to 3.0 (20110802 snap), fixes #732989
|
||||
|
||||
* Thu Mar 24 2011 Jerry James <loganjerry@gmail.com> - 3.0-3.20110227cvs
|
||||
- Update to 3.0 (20110227 snap)
|
||||
- Drop upstreamed -sigwinch patch
|
||||
|
Loading…
Reference in New Issue
Block a user