[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New versions of openbsd_{basename,dirname}.c



Hi!

On Tue, 2012-01-17 at 09:04:45 +0100, Svante Signell wrote:
> Dynamic allocation versions of openbsd_basename.c and openbsd_dirname.c
> are attached together with old functions together with some test strings
> in test_base+dirname.c. Comments are appreciated. Another part of the
> patch for libtar.

I don't think there's any need to patch the compat functions, as glibc
provides perfectly fine POSIX variants. The problem here seems to be
bogus configure tests. The attached patch should fix that.

thanks,
guillem
diff --git a/compat/module.ac b/compat/module.ac
index 6ebee97..31993ad 100644
--- a/compat/module.ac
+++ b/compat/module.ac
@@ -52,8 +52,7 @@ int main() {
 
   for (i = 0; tests[i].test; i++) {
     strcpy(test1, tests[i].test);
-    if (strcmp(basename(test1), tests[i].result) ||
-        strcmp(test1, tests[i].test))
+    if (strcmp(basename(test1), tests[i].result))
       exit(1);
   }
 
@@ -109,8 +108,7 @@ int main() {
 
   for (i = 0; tests[i].test; i++) {
     strcpy(test1, tests[i].test);
-    if (strcmp(dirname(test1), tests[i].result) ||
-        strcmp(test1, tests[i].test))
+    if (strcmp(dirname(test1), tests[i].result))
       exit(1);
   }
 

Reply to: