svn commit: trunk/busybox/debianutils

landley at busybox.net landley at busybox.net
Wed May 17 04:09:16 UTC 2006


Author: landley
Date: 2006-05-16 21:09:14 -0700 (Tue, 16 May 2006)
New Revision: 15092

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.


Modified:
   trunk/busybox/debianutils/readlink.c


Changeset:
Modified: trunk/busybox/debianutils/readlink.c
===================================================================
--- trunk/busybox/debianutils/readlink.c	2006-05-16 18:05:41 UTC (rev 15091)
+++ trunk/busybox/debianutils/readlink.c	2006-05-17 04:09:14 UTC (rev 15092)
@@ -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,7 @@
 		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