Re: Small cleanup for utilities/dbootstrap/release_notes.c
[Junichi Uekawa]
> Of course, there is no setlocale call.
Ah, of course. I'm not sure why, but I was sure that was taken care
of in some library somewhere. :-)
> If it doesn't work, you've found a real bug.
It works. Here is a new patch to be able to test displaying release
notes in other languages.
Index: release_notes.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/release_notes.c,v
retrieving revision 1.9
diff -u -3 -p -u -r1.9 release_notes.c
--- release_notes.c 2002/03/01 12:30:27 1.9
+++ release_notes.c 2002/03/11 23:07:41
@@ -3,14 +3,19 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#ifdef USE_LANGUAGE_CHOOSER
+#include <locale.h>
+#endif /* USE_LANGUAGE_CHOOSER */
#include "dbootstrap.h"
#include "lang.h"
#ifdef _TESTING_
# define RELEASE_FILE "../../scripts/rootdisk/messages/C/release_notes"
+# define RELEASE_FILE_FMT "../../scripts/rootdisk/messages/%s/release_notes"
#else
# define RELEASE_FILE "/release_notes"
+# define RELEASE_FILE_FMT "/release_notes.%s"
#endif
int
@@ -22,7 +27,7 @@ release_notes (const char *suffix)
char *fname = (char *)malloc (PATH_MAX);
if (suffix != NULL)
- snprintf (fname, PATH_MAX, "%s.%s", RELEASE_FILE, suffix);
+ snprintf (fname, PATH_MAX, RELEASE_FILE_FMT, suffix);
else
strcpy (fname, RELEASE_FILE);
@@ -67,6 +72,9 @@ release_notes (const char *suffix)
int main(int argc, char *argv[]){
char *msgcat = NULL;
+#ifdef USE_LANGUAGE_CHOOSER
+ setlocale(LC_ALL, "");
+#endif /* USE_LANGUAGE_CHOOSER */
LOAD_TRMFILE("test.trm");
get_kver();
boxInit();
Reply to: