summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD9
-rw-r--r--editline_wchar.patch49
3 files changed, 60 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 51dcee3db512..644223589f85 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,9 @@
+# Generated by mksrcinfo v8
+# Mon Jan 2 18:17:43 UTC 2017
pkgbase = eltclsh
pkgdesc = eltclsh (editline tcl shell) is an interactive shell for the TCL programming language
pkgver = 1.15
- pkgrel = 1
+ pkgrel = 2
url = http://homepages.laas.fr/mallet/soft/shell/eltclsh
arch = i686
arch = x86_64
@@ -13,7 +15,9 @@ pkgbase = eltclsh
depends = tk
depends = libedit
source = http://distfiles.openrobots.org/eltclsh/eltclsh-1.15.tar.gz
+ source = editline_wchar.patch
md5sums = 17f1f16ac44dff76a451fe62d8f4f8fd
+ md5sums = b6afc7dca1fe52d899886bf46652493a
pkgname = eltclsh
diff --git a/PKGBUILD b/PKGBUILD
index cf19c1419a9d..ede5190bc153 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: tequa
pkgname=eltclsh
pkgver=1.15
-pkgrel=1
+pkgrel=2
epoch=
pkgdesc="eltclsh (editline tcl shell) is an interactive shell for the TCL programming language"
arch=('i686' 'x86_64' 'armv7h')
@@ -19,12 +19,15 @@ backup=()
options=()
install=
changelog=
-source=("http://distfiles.openrobots.org/eltclsh/$pkgname-$pkgver.tar.gz")
+source=("http://distfiles.openrobots.org/eltclsh/$pkgname-$pkgver.tar.gz"
+ "editline_wchar.patch")
noextract=()
-md5sums=('17f1f16ac44dff76a451fe62d8f4f8fd')
+md5sums=('17f1f16ac44dff76a451fe62d8f4f8fd'
+ 'b6afc7dca1fe52d899886bf46652493a')
validpgpkeys=()
build() {
+ cat "${srcdir}/editline_wchar.patch" | patch -p1
cd "$pkgname-$pkgver"
./configure --prefix=/usr
make
diff --git a/editline_wchar.patch b/editline_wchar.patch
new file mode 100644
index 000000000000..7fd09308a661
--- /dev/null
+++ b/editline_wchar.patch
@@ -0,0 +1,49 @@
+diff -ur old/eltclsh-1.15/src/el.c new/eltclsh-1.15/src/el.c
+--- old/eltclsh-1.15/src/el.c 2012-12-06 17:27:21.000000000 +0100
++++ new/eltclsh-1.15/src/el.c 2017-01-02 18:54:01.368436684 +0100
+@@ -251,7 +251,7 @@
+ */
+
+ int
+-elTclEventLoop(EditLine *el, char *c)
++elTclEventLoop(EditLine *el, wchar_t *c)
+ {
+ ElTclInterpInfo *iinfo;
+ el_get(el, EL_CLIENTDATA, &iinfo);
+@@ -262,13 +262,20 @@
+
+ if (iinfo->preReadSz == 0 && feof(stdin)) {
+ /* eof and no pending character: leave */
+- c[0] = '0';
++ c[0] = L'\0';
+ return -1;
+ }
+
+- c[0] = iinfo->preRead[0];
+- if (iinfo->preReadSz-- > 0)
+- memmove(iinfo->preRead, iinfo->preRead+1, iinfo->preReadSz);
++ int mbSz = mblen (iinfo->preRead, iinfo->preReadSz);
++ if (mbSz > 0) {
++ mbtowc (c, iinfo->preRead, mbSz);
++ }
++ if (iinfo->preReadSz - mbSz >= 0) {
++ iinfo->preReadSz -= mbSz;
++ memmove(iinfo->preRead, iinfo->preRead+mbSz, iinfo->preReadSz);
++ } else {
++ iinfo->preReadSz = 0;
++ }
+
+ return 1;
+ }
+diff -ur old/eltclsh-1.15/src/eltclsh.h new/eltclsh-1.15/src/eltclsh.h
+--- old/eltclsh-1.15/src/eltclsh.h 2011-11-02 11:02:07.000000000 +0100
++++ new/eltclsh-1.15/src/eltclsh.h 2017-01-02 18:41:57.834330526 +0100
+@@ -112,7 +112,7 @@
+ Tcl_Obj *const objv[]);
+ int elTclHistory(ClientData data, Tcl_Interp *interp,
+ int objc, Tcl_Obj *const objv[]);
+-int elTclEventLoop(EditLine *el, char *c);
++int elTclEventLoop(EditLine *el, wchar_t *c);
+ void elTclRead(ClientData data, int mask);
+ int elTclGetWindowSize(int fd, int *lins, int *cols);
+