stdbuf: fix helper lib identification on some platforms
authorPádraig Brady <P@draigBrady.com>
Thu, 1 Sep 2011 14:23:17 +0000 (15:23 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 1 Sep 2011 14:27:58 +0000 (15:27 +0100)
* src/stdbuf.c (main): Pass the path of `stdbuf` rather than
the command it's running to the search function.  This is
significant on platforms without /proc/self/exe
Reported by Bruno Haible

src/stdbuf.c

index 6fd803c..0e2006b 100644 (file)
@@ -354,7 +354,7 @@ main (int argc, char **argv)
 
   /* Try to preload libstdbuf first from the same path as
      stdbuf is running from.  */
-  set_program_path (argv[0]);
+  set_program_path (program_name);
   if (!program_path)
     program_path = xstrdup (PKGLIBDIR);  /* Need to init to non NULL.  */
   set_LD_PRELOAD ();