svn commit: branches/busybox_1_1_stable/debianutils

aldot at busybox.net aldot at busybox.net
Fri May 19 10:57:03 UTC 2006


Author: aldot
Date: 2006-05-19 03:57:02 -0700 (Fri, 19 May 2006)
New Revision: 15115

Log:
The gnu extension to have realpath() malloc its buffer when handed a NULL
isn't implemented in uClibc, so we can't use it.
(r15092 from trunk plus coding-style fix for the patch)


Modified:
   branches/busybox_1_1_stable/debianutils/readlink.c


Changeset:
Modified: branches/busybox_1_1_stable/debianutils/readlink.c
===================================================================
--- branches/busybox_1_1_stable/debianutils/readlink.c	2006-05-19 10:54:46 UTC (rev 15114)
+++ branches/busybox_1_1_stable/debianutils/readlink.c	2006-05-19 10:57:02 UTC (rev 15115)
@@ -25,7 +25,7 @@
 			bb_show_usage();
 
 	if (opt & READLINK_FLAG_f)
-		buf = realpath(argv[optind], NULL);
+		buf = realpath(argv[optind], bb_common_bufsiz1);
 	else
 		buf = xreadlink(argv[ENABLE_FEATURE_READLINK_FOLLOW ? optind : 1]);
 
@@ -33,7 +33,8 @@
 		return EXIT_FAILURE;
 	puts(buf);
 
-	if (ENABLE_FEATURE_CLEAN_UP) free(buf);
+	if (ENABLE_FEATURE_CLEAN_UP && buf != bb_common_bufsiz1)
+		free(buf);
 
 	return EXIT_SUCCESS;
 }




More information about the busybox-cvs mailing list