[BusyBox-cvs] busybox/shellutils realpath.c,NONE,1.1 Config.in,1.1,1.2 Makefile.in,1.3,1.4

Glenn McGrath bug1 at busybox.net
Tue Dec 10 00:14:37 UTC 2002


Update of /var/cvs/busybox/shellutils
In directory winder:/tmp/cvs-serv20102/shellutils

Modified Files:
	Config.in Makefile.in 
Added Files:
	realpath.c 
Log Message:
Realpath applet


--- NEW FILE: realpath.c ---
/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#include <limits.h>
#include <stdlib.h>

#include "busybox.h"

int realpath_main(int argc, char **argv)
{
	char *resolved_path;
	int count;

	if (argc == 1) {
		show_usage();
	}

	resolved_path = malloc(PATH_MAX);

	for (count = 1; count < argc; count++) {
		resolved_path = realpath(argv[count], resolved_path);
		if (resolved_path) {
			puts(resolved_path);
		} else {
			perror_msg("%s", argv[count]);
		}
	}
	free(resolved_path);

	return(EXIT_SUCCESS);
}
Index: Config.in
===================================================================
RCS file: /var/cvs/busybox/shellutils/Config.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Config.in	5 Dec 2002 08:41:23 -0000	1.1
+++ Config.in	10 Dec 2002 00:14:33 -0000	1.2
@@ -112,6 +112,13 @@
 	help
 	  Please submit a patch to add help text for this item.
 
+config CONFIG_REALPATH
+	bool "realpath"
+	default n
+	help
+	  Return the canonicalized absolute pathname.
+	  This isnt provided by GNU shellutils, but where else does it belong.
+
 config CONFIG_SLEEP
 	bool "sleep"
 	default n

Index: Makefile.in
===================================================================
RCS file: /var/cvs/busybox/shellutils/Makefile.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Makefile.in	16 Sep 2002 09:10:04 -0000	1.3
+++ Makefile.in	10 Dec 2002 00:14:33 -0000	1.4
@@ -38,6 +38,7 @@
 SHELLUTILS-$(CONFIG_LOGNAME)		+= logname.o
 SHELLUTILS-$(CONFIG_PRINTF)		+= printf.o
 SHELLUTILS-$(CONFIG_PWD)		+= pwd.o
+SHELLUTILS-$(CONFIG_REALPATH)		+= realpath.o
 SHELLUTILS-$(CONFIG_SLEEP)		+= sleep.o
 SHELLUTILS-$(CONFIG_STTY)		+= stty.o
 SHELLUTILS-$(CONFIG_TEE)		+= tee.o




More information about the busybox-cvs mailing list