summaryrefslogtreecommitdiffstats
path: root/x11
diff options
context:
space:
mode:
authorolgeni <olgeni@FreeBSD.org>2006-03-21 00:10:27 +0000
committerolgeni <olgeni@FreeBSD.org>2006-03-21 00:10:27 +0000
commit108ff7864a4bea1732c120526ccc4c49c1bc99b5 (patch)
treefecc00f5cff44d036e37c8154a3686bd850f4c83 /x11
parente3332b46799b37fb66eaab68f3453bed137f2b91 (diff)
downloadFreeBSD-ports-108ff7864a4bea1732c120526ccc4c49c1bc99b5.zip
FreeBSD-ports-108ff7864a4bea1732c120526ccc4c49c1bc99b5.tar.gz
Fix composed character handling (broken as described in ports/78234).
Obtained from: Gentoo Bug 91878
Diffstat (limited to 'x11')
-rw-r--r--x11/eterm/Makefile2
-rw-r--r--x11/eterm/files/patch-src_misc.c59
-rw-r--r--x11/eterm/files/patch-src_misc.h13
-rw-r--r--x11/eterm/files/patch-src_options.c17
-rw-r--r--x11/eterm/files/patch-src_windows.c16
5 files changed, 106 insertions, 1 deletions
diff --git a/x11/eterm/Makefile b/x11/eterm/Makefile
index 665dd09..faaf7f2 100644
--- a/x11/eterm/Makefile
+++ b/x11/eterm/Makefile
@@ -7,7 +7,7 @@
PORTNAME= eterm
PORTVERSION= 0.9.3
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES+= x11
MASTER_SITES= http://www.eterm.org/download/
DISTNAME= Eterm-${PORTVERSION}
diff --git a/x11/eterm/files/patch-src_misc.c b/x11/eterm/files/patch-src_misc.c
new file mode 100644
index 0000000..fdf7149
--- /dev/null
+++ b/x11/eterm/files/patch-src_misc.c
@@ -0,0 +1,59 @@
+
+$FreeBSD$
+
+--- src/misc.c.orig
++++ src/misc.c
+@@ -223,6 +223,53 @@
+ return (pnew - str);
+ }
+
++spif_charptr_t
++escape_string(spif_charptr_t str, spif_char_t quote, spif_int32_t maxlen)
++{
++ spif_charptr_t buff, s = str, pbuff;
++
++ D_STRINGS(("escape_string(%s %c %ld)\n", (char *) str, quote, maxlen));
++ if (! quote) {
++ quote = '\"';
++ }
++
++ /* The escaped string will be at most twice the length of the original. */
++ buff = SPIF_CAST(charptr) MALLOC(strlen(SPIF_CAST_PTR(char) str) * 2 + 1);
++
++ /* Copy and escape the string from str into buff. */
++ for (pbuff = buff; (*s); s++, pbuff++) {
++ if (*s == quote) {
++ D_STRINGS(("Double-escaping \'%c\' at position %d\n", *s, s - str));
++ *pbuff = '\\';
++ pbuff++;
++ *pbuff = '\\';
++ pbuff++;
++ } else {
++ if (quote == '\"') {
++ if ((*s == '\\') || (*s == '`')) {
++ D_STRINGS(("Escaping \'%c\' at position %d\n", *s, s - str));
++ *pbuff = '\\';
++ pbuff++;
++ }
++ }
++ }
++ D_STRINGS(("Copying \'%c\' at position %d\n", *s, s - str));
++ *pbuff = *s;
++ }
++ *pbuff = 0;
++
++ if (maxlen) {
++ /* Given maxlen, we know "str" can hold at least "maxlen" chars. */
++ if (!spiftool_safe_strncpy(str, buff, maxlen)) {
++ str[maxlen] = 0;
++ }
++ FREE(buff);
++ return str;
++ } else {
++ return buff;
++ }
++}
++
+ char *
+ safe_print_string(const char *str, unsigned long len)
+ {
diff --git a/x11/eterm/files/patch-src_misc.h b/x11/eterm/files/patch-src_misc.h
new file mode 100644
index 0000000..a3c25a7
--- /dev/null
+++ b/x11/eterm/files/patch-src_misc.h
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- src/misc.h.orig
++++ src/misc.h
+@@ -40,6 +40,7 @@
+ extern unsigned long str_leading_match(register const char *, register const char *);
+ extern char *str_trim(char *str);
+ extern int parse_escaped_string(char *str);
++extern spif_charptr_t escape_string(spif_charptr_t str, spif_char_t quote, spif_int32_t maxlen);
+ extern char *safe_print_string(const char *buff, unsigned long len);
+ extern unsigned long add_carriage_returns(unsigned char *buff, unsigned long cnt);
+ extern unsigned char mkdirhier(const char *);
diff --git a/x11/eterm/files/patch-src_options.c b/x11/eterm/files/patch-src_options.c
new file mode 100644
index 0000000..af9f076
--- /dev/null
+++ b/x11/eterm/files/patch-src_options.c
@@ -0,0 +1,17 @@
+
+$FreeBSD$
+
+--- src/options.c.orig
++++ src/options.c
+@@ -3832,7 +3832,10 @@
+ }
+ #ifdef CUTCHAR_OPTION
+ if (rs_cutchars) {
+- fprintf(fp, " cut_chars '%s'\n", rs_cutchars);
++ spif_charptr_t cut_chars_escaped;
++
++ cut_chars_escaped = escape_string(SPIF_CAST(charptr) rs_cutchars, '\"', 0);
++ fprintf(fp, " cut_chars \"%s\"\n", (char *) cut_chars_escaped);
+ }
+ #endif
+ fprintf(fp, "end misc\n\n");
diff --git a/x11/eterm/files/patch-src_windows.c b/x11/eterm/files/patch-src_windows.c
new file mode 100644
index 0000000..6a481de
--- /dev/null
+++ b/x11/eterm/files/patch-src_windows.c
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- src/windows.c.orig
++++ src/windows.c
+@@ -467,9 +467,7 @@
+ XClearWindow(Xdisplay, TermWin.vt);
+ }
+ XDefineCursor(Xdisplay, TermWin.vt, TermWin_cursor);
+- TermWin.mask = (KeyPressMask | EnterWindowMask | LeaveWindowMask | ExposureMask
+- | ButtonPressMask | ButtonReleaseMask | Button1MotionMask
+- | Button2MotionMask | Button3MotionMask);
++ TermWin.mask = (EnterWindowMask | LeaveWindowMask | ExposureMask | ButtonPressMask | ButtonReleaseMask | Button1MotionMask | Button2MotionMask | Button3MotionMask);
+ XSelectInput(Xdisplay, TermWin.vt, TermWin.mask);
+
+ /* If the user wants a specific desktop, tell the WM that */
OpenPOWER on IntegriCloud