summary refs log tree commit diff
path: root/localedata/bug-setlocale1.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2013-01-10 14:15:49 -0800
committerH.J. Lu <hjl.tools@gmail.com>2013-01-10 14:15:49 -0800
commitc34521ceac1ba7aee2afa06a883415605ba9e07c (patch)
tree97111f4f36b9904ed7ac11c3d0dff312e12f4a8e /localedata/bug-setlocale1.c
parent4cf8f2098f227d32f3b73c70a6498c84872c24ba (diff)
downloadglibc-c34521ceac1ba7aee2afa06a883415605ba9e07c.tar.gz
glibc-c34521ceac1ba7aee2afa06a883415605ba9e07c.tar.xz
glibc-c34521ceac1ba7aee2afa06a883415605ba9e07c.zip
Support run bug-setlocale1 directly
Diffstat (limited to 'localedata/bug-setlocale1.c')
-rw-r--r--localedata/bug-setlocale1.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/localedata/bug-setlocale1.c b/localedata/bug-setlocale1.c
index cf787be02c..dc7f6f3f08 100644
--- a/localedata/bug-setlocale1.c
+++ b/localedata/bug-setlocale1.c
@@ -12,16 +12,16 @@ do_test (int argc, char *argv[])
   if (argc > 1)
     {
       char *newargv[5];
-      asprintf (&newargv[0], "%self/ld.so", argv[1]);
-      if (newargv[0] == NULL)
+      int i;
+      if (argc != 2 && argc != 5)
 	{
-	  puts ("asprintf failed");
+	  printf ("wrong number of arguments (%d)\n", argc);
 	  return 1;
 	}
-      newargv[1] = (char *) "--library-path";
-      newargv[2] = argv[1];
-      newargv[3] = argv[0];
-      newargv[4] = NULL;
+
+      for (i = 0; i < (argc == 5 ? 4 : 1); i++)
+	newargv[i] = argv[i + 1];
+      newargv[i] = NULL;
 
       char *env[3];
       env[0] = (char *) "LC_CTYPE=de_DE.UTF-8";
@@ -32,9 +32,9 @@ do_test (int argc, char *argv[])
 	  return 1;
 	}
       asprintf (&env[1], "LOCPATH=%s", loc);
-      if (newargv[0] == NULL)
+      if (env[1] == NULL)
 	{
-	  puts ("second asprintf failed");
+	  puts ("asprintf failed");
 	  return 1;
 	}
       env[2] = NULL;