summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2019-09-02 14:07:45 +0000
committerschwarze <schwarze@openbsd.org>2019-09-02 14:07:45 +0000
commita0ba958dd2dec3c4221e0166cb3aa316f6ddf894 (patch)
treed7ec9713dba573e5060af2ef17b437d601470cc6
parentFix a route use after free in multicast route. Move the rt_mcast_del() (diff)
downloadwireguard-openbsd-a0ba958dd2dec3c4221e0166cb3aa316f6ddf894.tar.xz
wireguard-openbsd-a0ba958dd2dec3c4221e0166cb3aa316f6ddf894.zip
Delete what remains of the support for combining characters into
ligatures: it was incomplete (only for the Arabic script and only for the single ligature LAM WITH ALEF) and it was implemented in a way that is unsustainable (with a static table inside less). If we ever want ligature support, we are better off making a fresh start. However, for languages like Arabic and Persian, even that wouldn't really be useful without having bidirectional support first. OK millert@ (and also considering comments from Mohammadreza Abdollahzadeh, Evan Silberman, and benno@)
-rw-r--r--usr.bin/less/charset.c25
-rw-r--r--usr.bin/less/cmdbuf.c17
-rw-r--r--usr.bin/less/funcs.h1
-rw-r--r--usr.bin/less/less.16
4 files changed, 7 insertions, 42 deletions
diff --git a/usr.bin/less/charset.c b/usr.bin/less/charset.c
index 5739fe1b71a..3090dea6364 100644
--- a/usr.bin/less/charset.c
+++ b/usr.bin/less/charset.c
@@ -474,13 +474,6 @@ static struct wchar_range comp_table[] = {
};
/*
- * Special pairs, not ranges.
- */
-static struct wchar_range comb_table[] = {
- {0x0644, 0x0622}, {0x0644, 0x0623}, {0x0644, 0x0625}, {0x0644, 0x0627},
-};
-
-/*
* Characters with general category values
* Cc: Other, Control
* Cf: Other, Format
@@ -826,21 +819,3 @@ is_wide_char(LWCHAR ch)
return (is_in_table(ch, wide_table,
(sizeof (wide_table) / sizeof (*wide_table))));
}
-
-/*
- * Is a character a UTF-8 combining character?
- * A combining char acts like an ordinary char, but if it follows
- * a specific char (not any char), the two combine into one glyph.
- */
-int
-is_combining_char(LWCHAR ch1, LWCHAR ch2)
-{
- /* The table is small; use linear search. */
- int i;
- for (i = 0; i < sizeof (comb_table) / sizeof (*comb_table); i++) {
- if (ch1 == comb_table[i].first &&
- ch2 == comb_table[i].last)
- return (1);
- }
- return (0);
-}
diff --git a/usr.bin/less/cmdbuf.c b/usr.bin/less/cmdbuf.c
index aaafed8de75..0aaa1f0686d 100644
--- a/usr.bin/less/cmdbuf.c
+++ b/usr.bin/less/cmdbuf.c
@@ -179,19 +179,10 @@ cmd_step_common(char *p, LWCHAR ch, int len, int *pwidth, int *bswidth)
if (bswidth != NULL)
*bswidth = prlen;
} else {
- LWCHAR prev_ch = step_char(&p, -1, cmdbuf);
- if (is_combining_char(prev_ch, ch)) {
- if (pwidth != NULL)
- *pwidth = 0;
- if (bswidth != NULL)
- *bswidth = 0;
- } else {
- if (pwidth != NULL)
- *pwidth = is_wide_char(ch)
- ? 2 : 1;
- if (bswidth != NULL)
- *bswidth = 1;
- }
+ if (pwidth != NULL)
+ *pwidth = is_wide_char(ch) ? 2 : 1;
+ if (bswidth != NULL)
+ *bswidth = 1;
}
}
}
diff --git a/usr.bin/less/funcs.h b/usr.bin/less/funcs.h
index 5ef595a3bbe..2e707c3f606 100644
--- a/usr.bin/less/funcs.h
+++ b/usr.bin/less/funcs.h
@@ -65,7 +65,6 @@ LWCHAR step_char(char **, int, char *);
int is_composing_char(LWCHAR);
int is_ubin_char(LWCHAR);
int is_wide_char(LWCHAR);
-int is_combining_char(LWCHAR, LWCHAR);
void cmd_reset(void);
void clear_cmd(void);
void cmd_putstr(char *);
diff --git a/usr.bin/less/less.1 b/usr.bin/less/less.1
index 20acf5fe2d9..5a52be5da07 100644
--- a/usr.bin/less/less.1
+++ b/usr.bin/less/less.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: less.1,v 1.56 2019/08/20 11:34:18 jmc Exp $
+.\" $OpenBSD: less.1,v 1.57 2019/09/02 14:07:45 schwarze Exp $
.\"
.\" Copyright (C) 1984-2012 Mark Nudelman
.\"
@@ -23,7 +23,7 @@
.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: August 20 2019 $
+.Dd $Mdocdate: September 2 2019 $
.Dt LESS 1
.Os
.Sh NAME
@@ -1804,7 +1804,7 @@ Language for determining the character set.
The character encoding
.Xr locale 1 .
It decides which byte sequences form characters, what their display
-width is, and which characters are composing or combining characters.
+width is, and which characters are composing characters.
.It Ev LESS
Options which are passed to
.Nm