mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
More GSFormat fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9036 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
68f10b82e5
commit
61694a4b3f
2 changed files with 11 additions and 7 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2001-02-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/GSFormat.m: merged in some more fixes by Kai.
|
||||||
|
|
||||||
2001-02-07 Richard Frith-Macdonald <rfm@gnu.org>
|
2001-02-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/GSFormat.m: Fixed error in PAD() macro - it was failing to
|
* Source/GSFormat.m: Fixed error in PAD() macro - it was failing to
|
||||||
|
|
|
@ -1122,6 +1122,7 @@ NSDictionary *locale)
|
||||||
/* Process format specifiers. */
|
/* Process format specifiers. */
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
int string_malloced;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
const void *ptr;
|
const void *ptr;
|
||||||
|
@ -1499,8 +1500,8 @@ NSDictionary *locale)
|
||||||
/* Make sure the full string "(nil)" is printed. */
|
/* Make sure the full string "(nil)" is printed. */
|
||||||
if (prec < 5)
|
if (prec < 5)
|
||||||
prec = 5;
|
prec = 5;
|
||||||
is_long = 0; /* This is no wide-char string. */
|
string_malloced = 0;
|
||||||
goto LABEL (print_string);
|
goto LABEL (print_uni_string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
|
@ -1524,8 +1525,7 @@ NSDictionary *locale)
|
||||||
LABEL (form_strerror):
|
LABEL (form_strerror):
|
||||||
/* Print description of error ERRNO. */
|
/* Print description of error ERRNO. */
|
||||||
string =
|
string =
|
||||||
(unichar *) __strerror_r (save_errno, (char *) work_buffer,
|
(unichar *) strerror(save_errno);
|
||||||
sizeof work_buffer);
|
|
||||||
is_long = 0; /* This is no wide-char string. */
|
is_long = 0; /* This is no wide-char string. */
|
||||||
goto LABEL (print_string);
|
goto LABEL (print_string);
|
||||||
LABEL (form_character):
|
LABEL (form_character):
|
||||||
|
@ -1556,7 +1556,6 @@ NSDictionary *locale)
|
||||||
LABEL (form_string):
|
LABEL (form_string):
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
int string_malloced;
|
|
||||||
|
|
||||||
/* The string argument could in fact be `char *' or `wchar_t *'.
|
/* The string argument could in fact be `char *' or `wchar_t *'.
|
||||||
But this should not make a difference here. */
|
But this should not make a difference here. */
|
||||||
|
@ -1633,6 +1632,7 @@ NSDictionary *locale)
|
||||||
while (prc--) *sp = *wsp;
|
while (prc--) *sp = *wsp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LABEL (print_uni_string):
|
||||||
if ((width -= len) <= 0)
|
if ((width -= len) <= 0)
|
||||||
{
|
{
|
||||||
outstring (string, len);
|
outstring (string, len);
|
||||||
|
@ -1652,7 +1652,6 @@ NSDictionary *locale)
|
||||||
LABEL (form_object):
|
LABEL (form_object):
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
int string_malloced;
|
|
||||||
id obj;
|
id obj;
|
||||||
NSString *dsc;
|
NSString *dsc;
|
||||||
|
|
||||||
|
@ -1672,7 +1671,8 @@ NSDictionary *locale)
|
||||||
NSString into a unicode string. */
|
NSString into a unicode string. */
|
||||||
NSRange r;
|
NSRange r;
|
||||||
|
|
||||||
len = prec != -1 ? prec : [dsc length];
|
len = [dsc length];
|
||||||
|
if (prec >= 0 && prec < len) len = prec;
|
||||||
|
|
||||||
/* Allocate dynamically an array which definitely is long
|
/* Allocate dynamically an array which definitely is long
|
||||||
enough for the wide character version. */
|
enough for the wide character version. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue