util-linux/util-linux-2.13-cal-wide.patch

237 lines
5.7 KiB
Diff
Raw Normal View History

--- util-linux-2.13-pre7/include/widechar.h.kzak 2005-08-01 20:18:35.000000000 +0200
+++ util-linux-2.13-pre7/include/widechar.h 2006-03-29 19:38:56.000000000 +0200
@@ -2,7 +2,7 @@
/* This file must be included last because the redefinition of wchar_t may
cause conflicts when system include files were included after it. */
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
# include <wchar.h>
# include <wctype.h>
--- util-linux-2.13-pre7/misc-utils/cal.c.kzak 2006-03-29 19:40:26.000000000 +0200
+++ util-linux-2.13-pre7/misc-utils/cal.c 2006-03-29 19:40:34.000000000 +0200
@@ -355,7 +355,7 @@
exit(0);
}
-#ifndef ENABLE_WIDECHAR
+#ifndef HAVE_WIDECHAR
static char *eos(char *s) {
while (s && *s)
s++;
@@ -366,14 +366,14 @@
void headers_init(void)
{
int i, wd;
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
wchar_t day_headings_wc[22],j_day_headings_wc[29];
char *cur_dh = day_headings, *cur_j_dh = j_day_headings;
#endif
strcpy(day_headings,"");
strcpy(j_day_headings,"");
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
wcscpy(day_headings_wc,L"");
wcscpy(j_day_headings_wc,L"");
#endif
@@ -387,7 +387,7 @@
for(i = 0 ; i < 7 ; i++ ) {
ssize_t space_left;
wd = (i + week1stday) % 7;
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
swprintf(day_headings_wc, sizeof(day_headings_wc)/sizeof(day_headings_wc[0]),
L"%1.2s ", weekday(wd));
swprintf(j_day_headings_wc, sizeof(j_day_headings_wc)/sizeof(j_day_headings_wc[0]),
@@ -718,7 +718,7 @@
void
center_str(const char* src, char* dest, size_t dest_size, int width)
{
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
wchar_t str_wc[FMT_ST_CHARS];
#endif
char str[FMT_ST_CHARS];
@@ -727,7 +727,7 @@
len = strlen(src);
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
if (mbstowcs(str_wc, src, FMT_ST_CHARS) > 0) {
wide_char_enabled = 1;
len = wcswidth(str_wc, SIZE(str_wc));
@@ -736,7 +736,7 @@
if (len > width) {
str_to_print=str;
if (wide_char_enabled) {
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
str_wc[width]=L'\0';
wcstombs(str, str_wc, SIZE(str));
#endif
--- util-linux-2.13-pre7/text-utils/column.c.kzak 2006-03-29 19:41:20.000000000 +0200
+++ util-linux-2.13-pre7/text-utils/column.c 2006-03-29 19:41:25.000000000 +0200
@@ -52,7 +52,7 @@
#include "widechar.h"
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
#define wcs_width(s) wcswidth(s,wcslen(s))
static wchar_t *mbs_to_wcs(const char *);
#else
@@ -312,7 +312,7 @@
}
}
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
static wchar_t *mbs_to_wcs(const char *s)
{
size_t n;
@@ -330,7 +330,7 @@
}
#endif
-#ifndef ENABLE_WIDECHAR
+#ifndef HAVE_WIDECHAR
static char *mtsafe_strtok(char *str, const char *delim, char **ptr)
{
if (str == NULL) {
--- util-linux-2.13-pre7/text-utils/pg.c.kzak 2006-03-29 19:41:52.000000000 +0200
+++ util-linux-2.13-pre7/text-utils/pg.c 2006-03-29 19:41:59.000000000 +0200
@@ -255,7 +255,7 @@
usage();
}
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
/*
* A mbstowcs()-alike function that transparently handles invalid sequences.
*/
@@ -402,7 +402,7 @@
return 0;
}
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
/*
* Return the last character that will fit on the line at col columns
* in case MB_CUR_MAX > 1.
@@ -489,7 +489,7 @@
unsigned pos = 0;
char *t = s;
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
if (MB_CUR_MAX > 1)
return endline_for_mb(col, s);
#endif
@@ -776,7 +776,7 @@
cmd.count = getcount(cmd.cmdline);
}
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
/*
* Remove backspace formatting, for searches
* in case MB_CUR_MAX > 1.
@@ -817,7 +817,7 @@
{
char *p = s, *q;
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
if (MB_CUR_MAX > 1)
return colb_for_mb(s);
#endif
@@ -836,7 +836,7 @@
return s;
}
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
/*
* Convert nonprintable characters to spaces
* in case MB_CUR_MAX > 1.
@@ -867,7 +867,7 @@
static void
makeprint(char *s, size_t l)
{
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
if (MB_CUR_MAX > 1)
return makeprint_for_mb(s, l);
#endif
--- util-linux-2.13-pre7/text-utils/more.c.kzak 2006-03-29 19:41:01.000000000 +0200
+++ util-linux-2.13-pre7/text-utils/more.c 2006-03-29 19:41:08.000000000 +0200
@@ -782,7 +782,7 @@
int column;
static int colflg;
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
int i;
wchar_t wc;
int wc_width;
@@ -805,7 +805,7 @@
c = Getc (f);
}
while (p < &Line[LINSIZ - 1]) {
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
if (fold_opt && use_mbc_buffer_flag && MB_CUR_MAX > 1) {
use_mbc_buffer_flag = 0;
state_bak = state;
@@ -923,7 +923,7 @@
*length = p - Line;
return (column);
} else {
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
if (fold_opt && MB_CUR_MAX > 1) {
memset (mbc, '\0', MB_LEN_MAX);
mbc_pos = 0;
@@ -1054,7 +1054,7 @@
my_putstring(state ? ULenter : ULexit);
}
if (c != ' ' || pstate == 0 || state != 0 || ulglitch == 0)
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
{
wchar_t wc;
size_t mblength;
@@ -1070,7 +1070,7 @@
}
#else
putchar(c);
-#endif /* ENABLE_WIDECHAR */
+#endif /* HAVE_WIDECHAR */
if (state && *chUL) {
putsout(chBS);
my_putstring(chUL);
@@ -1867,7 +1867,7 @@
}
else if (((cc_t) c == otty.c_cc[VERASE]) && !slash) {
if (sp > buf) {
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
if (MB_CUR_MAX > 1)
{
wchar_t wc;
--- util-linux-2.13-pre7/text-utils/ul.c.kzak 2006-03-29 19:42:09.000000000 +0200
+++ util-linux-2.13-pre7/text-utils/ul.c 2006-03-29 19:42:25.000000000 +0200
@@ -50,7 +50,7 @@
#include "widechar.h"
-#ifdef ENABLE_WIDECHAR
+#ifdef HAVE_WIDECHAR
static int put1wc(int c) /* Output an ASCII character as a wide character */
{
if (putwchar(c) == WEOF)