Group :: Sistema/Bibliotecas
RPM: libjpeg
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: libjpeg-6b-alt-rdjpgcom-i18n.patch
Download
Download
--- jpeg-6b.orig/rdjpgcom.c 1997-10-12 02:41:04 +0400
+++ jpeg-6b/rdjpgcom.c 2004-10-11 20:31:38 +0400
@@ -15,6 +15,7 @@
#include "jinclude.h" /* get auto-config symbols, <stdio.h> */
#include <ctype.h> /* to declare isupper(), tolower() */
+#include <locale.h> /* for setlocale() */
#ifdef USE_SETMODE
#include <fcntl.h> /* to declare setmode()'s parameter macros */
/* If you have setmode() but not <io.h>, just delete this line: */
@@ -223,6 +224,7 @@ process_COM (void)
unsigned int length;
int ch;
int lastch = 0;
+ const char *prev_locale;
/* Get the marker parameter length count */
length = read_2_bytes();
@@ -231,6 +233,8 @@ process_COM (void)
ERREXIT("Erroneous JPEG marker length");
length -= 2;
+ prev_locale = setlocale(LC_CTYPE, "");
+
while (length > 0) {
ch = read_1_byte();
/* Emit the character in a readable form.
@@ -254,6 +258,9 @@ process_COM (void)
length--;
}
printf("\n");
+
+ if (prev_locale)
+ setlocale(LC_CTYPE, "C");
}