Репозитории ALT
Группа :: Терминалы
Пакет: xterm
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: 0008-xterm-alt-i18n.patch
Скачать
Скачать
From 0 Mon Sep 17 00:00:00 2001
From: "George V. Kouryachy (Fr. Br. George)" <george@altlinux.ru>
Date: Thu, 17 Oct 2019 13:13:48 +0300
Subject: [PATCH] xterm-alt-i18n
diff --git a/xterm/button.c b/xterm/button.c
index defaced..defaced 100644
--- a/xterm/button.c
+++ b/xterm/button.c
@@ -64,6 +64,7 @@ button.c Handles button events in the terminal emulator.
#include <stdio.h>
#include <ctype.h>
#include <assert.h>
+#include <ctype.h>
#include <X11/Xatom.h>
#include <X11/Xmu/Atoms.h>
@@ -3101,6 +3102,16 @@ static int charClass[256] =
48, 48, 48, 48, 48, 48, 48, 48};
/* *INDENT-ON* */
+void
+init_classtab (void)
+{
+ int i;
+
+ for (i = 1; i < 256; ++i)
+ if (isalnum (i))
+ charClass[i] = '0';
+}
+
int
SetCharacterClassRange(int low, /* in range of [0..255] */
int high,
diff --git a/xterm/charclass.c b/xterm/charclass.c
index defaced..defaced 100644
--- a/xterm/charclass.c
+++ b/xterm/charclass.c
@@ -55,6 +55,7 @@
#include <xterm.h>
#include <charclass.h>
+#include <ctype.h>
#if OPT_WIDE_CHARS
@@ -101,6 +102,7 @@ static int opt_v;
void
init_classtab(void)
{
+ int i;
const int size = 50;
TRACE(("init_classtab {{\n"));
@@ -126,6 +128,10 @@ init_classtab(void)
SetCharacterClassRange(215, 215, IDENT);
SetCharacterClassRange(247, 247, IDENT);
+ for (i = 1; i < 256; ++i)
+ if (isalnum (i) && CharacterClass(i) != 48)
+ SetCharacterClassRange(i, i, 48);
+
/* added Unicode classes */
SetCharacterClassRange(0x0100, 0xffdf, ALNUM); /* mostly characters */
SetCharacterClassRange(0x037e, 0x037e, IDENT); /* Greek question mark */
diff --git a/xterm/main.c b/xterm/main.c
index defaced..defaced 100644
--- a/xterm/main.c
+++ b/xterm/main.c
@@ -2530,10 +2530,8 @@ main(int argc, char *argv[]ENVP_ARG)
XtSetValues(toplevel, ourTopLevelShellArgs,
number_ourTopLevelShellArgs);
-#if OPT_WIDE_CHARS
/* seems as good a place as any */
init_classtab();
-#endif
/* Parse the rest of the command line */
TRACE_ARGV("After XtOpenApplication", argv);