Whamcloud - gitweb
mke2fs: add simple tests and re-alphabetize mke2fs manpage options
[tools/e2fsprogs.git] / misc / uuidgen.c
index 6e3fb31..f181d19 100644 (file)
@@ -9,11 +9,15 @@
  * %End-Header%
  */
 
+#include "config.h"
 #include <stdio.h>
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
+extern int getopt(int argc, char * const argv[], const char *optstring);
 extern char *optarg;
 extern int optind;
 #endif
@@ -37,6 +41,13 @@ main (int argc, char *argv[])
        char   str[37];
        uuid_t uu;
 
+#ifdef ENABLE_NLS
+       setlocale(LC_MESSAGES, "");
+       setlocale(LC_CTYPE, "");
+       bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
+       textdomain(NLS_CAT_NAME);
+#endif
+
        while ((c = getopt (argc, argv, "tr")) != EOF)
                switch (c) {
                case 't':
@@ -48,7 +59,7 @@ main (int argc, char *argv[])
                default:
                        usage(argv[0]);
                }
-       
+
        switch (do_type) {
        case DO_TYPE_TIME:
                uuid_generate_time(uu);
@@ -60,7 +71,7 @@ main (int argc, char *argv[])
                uuid_generate(uu);
                break;
        }
-       
+
        uuid_unparse(uu, str);
 
        printf("%s\n", str);