mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-03 16:59:22 +02:00
commit bash-20100603 snapshot
This commit is contained in:
+6
-1
@@ -92,7 +92,7 @@ CSOURCES = clktck.c clock.c getcwd.c getenv.c oslib.c setlinebuf.c \
|
||||
mktime.c strftime.c mbschr.c zcatfd.c zmapfd.c winsize.c eaccess.c \
|
||||
wcsdup.c fpurge.c zgetline.c mbscmp.c uconvert.c ufuncs.c \
|
||||
casemod.c dprintf.c input_avail.c mbscasecmp.c fnxform.c \
|
||||
strchrnul.c unicode.c
|
||||
strchrnul.c unicode.c wcswidth.c
|
||||
|
||||
# The header files for this library.
|
||||
HSOURCES =
|
||||
@@ -196,6 +196,7 @@ uconvert.o: uconvert.c
|
||||
ufuncs.o: ufuncs.c
|
||||
vprint.o: vprint.c
|
||||
wcsdup.o: wcsdup.c
|
||||
wcswidth.o: wcswidth.c
|
||||
mbschr.o: mbschr.c
|
||||
zcatfd.o: zcatfd.c
|
||||
zmapfd.o: zmapfd.c
|
||||
@@ -266,6 +267,7 @@ uconvert.o: ${BUILD_DIR}/config.h
|
||||
ufuncs.o: ${BUILD_DIR}/config.h
|
||||
vprint.o: ${BUILD_DIR}/config.h
|
||||
wcsdup.o: ${BUILD_DIR}/config.h
|
||||
wcswidth.o: ${BUILD_DIR}/config.h
|
||||
mbschr.o: ${BUILD_DIR}/config.h
|
||||
zcatfd.o: ${BUILD_DIR}/config.h
|
||||
zgetline.o: ${BUILD_DIR}/config.h
|
||||
@@ -506,6 +508,9 @@ wcsdup.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h
|
||||
wcsdup.o: ${BASHINCDIR}/stdc.h
|
||||
wcsdup.o: ${topdir}/xmalloc.h
|
||||
|
||||
wcswidth.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h
|
||||
wcswidth.o: ${BASHINCDIR}/stdc.h
|
||||
|
||||
mbschr.o: ${topdir}/bashansi.h
|
||||
mbschr.o: ${BASHINCDIR}/ansi_stdlib.h
|
||||
mbschr.o: ${BASHINCDIR}/shmbutil.h
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
# Makefile for the Bash library
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1998-2009 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1998-2010 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -92,7 +92,7 @@ CSOURCES = clktck.c clock.c getcwd.c getenv.c oslib.c setlinebuf.c \
|
||||
mktime.c strftime.c mbschr.c zcatfd.c zmapfd.c winsize.c eaccess.c \
|
||||
wcsdup.c fpurge.c zgetline.c mbscmp.c uconvert.c ufuncs.c \
|
||||
casemod.c dprintf.c input_avail.c mbscasecmp.c fnxform.c \
|
||||
strchrnul.c
|
||||
strchrnul.c unicode.c
|
||||
|
||||
# The header files for this library.
|
||||
HSOURCES =
|
||||
@@ -106,7 +106,7 @@ OBJECTS = clktck.o clock.o getenv.o oslib.o setlinebuf.o strnlen.o \
|
||||
strtrans.o snprintf.o mailstat.o fmtulong.o \
|
||||
fmtullong.o fmtumax.o zcatfd.o zmapfd.o winsize.o wcsdup.o \
|
||||
fpurge.o zgetline.o mbscmp.o uconvert.o ufuncs.o casemod.o \
|
||||
input_avail.o mbscasecmp.o fnxform.o ${LIBOBJS}
|
||||
input_avail.o mbscasecmp.o fnxform.o unicode.o ${LIBOBJS}
|
||||
|
||||
SUPPORT = Makefile
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/* wcswidth.c - compute display width of wide character string */
|
||||
|
||||
/* Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
Bash is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bash is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bash. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE) && !defined (HAVE_WCSWIDTH)
|
||||
|
||||
#include <stdc.h>
|
||||
#include <wchar.h>
|
||||
#include <bashansi.h>
|
||||
|
||||
int
|
||||
wcswidth(pwcs, n)
|
||||
const wchar_t *pwcs;
|
||||
size_t n;
|
||||
{
|
||||
wchar_t wc;
|
||||
int len, l;
|
||||
|
||||
len = 0;
|
||||
while (n-- > 0 && (wc = *pwcs++) != L'\0')
|
||||
{
|
||||
if ((l = wcwidth(wc)) < 0)
|
||||
return (-1);
|
||||
len += l;
|
||||
}
|
||||
return (len);
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,26 @@
|
||||
#include <config.h>
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE) && !defined (HAVE_WCSWIDTH)
|
||||
|
||||
#include <stdc.h>
|
||||
#include <wchar.h>
|
||||
#include <bashansi.h>
|
||||
|
||||
int
|
||||
wcswidth(pwcs, n)
|
||||
const wchar_t *pwcs;
|
||||
size_t n;
|
||||
{
|
||||
wchar_t wc;
|
||||
int len, l;
|
||||
|
||||
len = 0;
|
||||
while (n-- > 0 && (wc = *pwcs++) != L'\0')
|
||||
{
|
||||
if ((l = wcwidth(wc)) < 0)
|
||||
return (-1);
|
||||
len += l;
|
||||
}
|
||||
return (len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user