changeset 29230:ba817848d669

Work around circular library issue when cross-compiling. * lib/progname.c (set_program_name): Use strncmp, not memcmp, so that progname.o does not need to pull in rpl_memcmp. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Thu, 20 Dec 2007 13:15:27 -0700
parents 20d66442dcb3
children d6ef4c61f19a
files ChangeLog lib/progname.c
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Dec 19 16:09:03 2007 -0700
+++ b/ChangeLog	Thu Dec 20 13:15:27 2007 -0700
@@ -1,3 +1,9 @@
+2007-12-20  Eric Blake  <ebb9@byu.net>
+
+	Work around circular library issue when cross-compiling.
+	* lib/progname.c (set_program_name): Use strncmp, not memcmp, so
+	that progname.o does not need to pull in rpl_memcmp.
+
 2007-12-19  Eric Blake  <ebb9@byu.net>
 
 	Fix memmem to avoid O(n^2) worst-case complexity.
--- a/lib/progname.c	Wed Dec 19 16:09:03 2007 -0700
+++ b/lib/progname.c	Thu Dec 20 13:15:27 2007 -0700
@@ -1,5 +1,5 @@
 /* Program name management.
-   Copyright (C) 2001-2003, 2005-2006 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2007 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -41,7 +41,7 @@
 
   slash = strrchr (argv0, '/');
   base = (slash != NULL ? slash + 1 : argv0);
-  if (base - argv0 >= 7 && memcmp (base - 7, "/.libs/", 7) == 0)
+  if (base - argv0 >= 7 && strncmp (base - 7, "/.libs/", 7) == 0)
     argv0 = base;
   if (strncmp (base, "lt-", 3) == 0)
     argv0 = base + 3;