From 1feeb90cf7070055bcba1fb4bdbc02ade8c8b7be Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 26 Aug 2011 12:40:41 +0200 Subject: [PATCH] Update to 3.0 (20110802 snap), fixes #732989 --- .gitignore | 1 + libedit-3.0-warnings.patch | 93 -------------------------------------- libedit.spec | 9 ++-- sources | 2 +- 4 files changed, 6 insertions(+), 99 deletions(-) delete mode 100644 libedit-3.0-warnings.patch diff --git a/.gitignore b/.gitignore index 0b3808a..4f78597 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ libedit-20110227-3.0.tar.gz +/libedit-20110802-3.0.tar.gz diff --git a/libedit-3.0-warnings.patch b/libedit-3.0-warnings.patch deleted file mode 100644 index eb0efbe..0000000 --- a/libedit-3.0-warnings.patch +++ /dev/null @@ -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(): diff --git a/libedit.spec b/libedit.spec index 516021a..6260d8b 100644 --- a/libedit.spec +++ b/libedit.spec @@ -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 3.0-3.20110802cvs +- Update to 3.0 (20110802 snap), fixes #732989 + * Thu Mar 24 2011 Jerry James - 3.0-3.20110227cvs - Update to 3.0 (20110227 snap) - Drop upstreamed -sigwinch patch diff --git a/sources b/sources index 92e4b20..a45facc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -411e0a79c36a2e8d64b160b4ca2fcf53 libedit-20110227-3.0.tar.gz +0ea42e2c794da8ed32f6307b427f6590 libedit-20110802-3.0.tar.gz