From 18a1b87b70a6f76174d15fd1623f9956501e152e Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Sat, 14 Jun 2003 11:07:03 +0000 Subject: [PATCH] Fixed bug where textdir() didn't return a valid string for normal text! (D'oh!) --- docs/CHANGES.txt | 3 ++- src/tuxpaint.c | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 653a67de4..90853187a 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -7,7 +7,7 @@ bill@newbreedsoftware.com http://www.newbreedsoftware.com/tuxpaint/ -2003.May.23 (0.9.11) [cvs] +2003.Jun.14 (0.9.11) [cvs] * Windows bugfixes. John Popplewell @@ -62,6 +62,7 @@ http://www.newbreedsoftware.com/tuxpaint/ * When a locale requiring its own font can't be used because the font is missing, Tux Paint STILL didn't work right. Fixed. (Set $LC_ALL=C) + * Added a set of square brushes (similar to the various round ones). 2003.February.22 (0.9.10) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 81fec7709..37fc7f114 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -6370,7 +6370,7 @@ void wordwrap_text(TTF_Font * font, char * str, SDL_Color color, (need_utf8(language) && strcmp(gettext(str), str) != 0))) { if (want_utf8 || want_right_to_left == 0) - locale_str = strdup(str); + locale_str = strdup(gettext(str)); else locale_str = strdup(textdir(gettext(str))); @@ -6552,7 +6552,7 @@ void wordwrap_text(TTF_Font * font, char * str, SDL_Color color, strcmp(gettext(str), str) != 0 && strcmp(str, "") != 0) { if (want_right_to_left == 0) - locale_str = strdup(str); + locale_str = strdup(gettext(str)); else locale_str = strdup(textdir(gettext(str))); @@ -10233,6 +10233,10 @@ unsigned char * textdir(unsigned char * str) unsigned char * dstr; int i, j; +#ifdef DEBUG + printf("ORIG_DIR: %s\n", str); +#endif + dstr = (unsigned char *) malloc((strlen(str) + 5) * sizeof(unsigned char)); if (need_right_to_left(language)) @@ -10270,6 +10274,14 @@ unsigned char * textdir(unsigned char * str) } } } + else + { + strcpy(dstr, str); + } + +#ifdef DEBUG + printf("L2R_DIR: %s\n", dstr); +#endif return (dstr); }