svn commit: trunk/busybox: applets coreutils include libbb libpwdgr etc...

landley at busybox.net landley at busybox.net
Sun Jun 18 20:20:11 UTC 2006


Author: landley
Date: 2006-06-18 13:20:07 -0700 (Sun, 18 Jun 2006)
New Revision: 15420

Log:
skip_whitespace() shouldn't claim its return value is const, it doesn't know
that and callers wind up typecasting it back.


Modified:
   trunk/busybox/applets/applets.c
   trunk/busybox/coreutils/ls.c
   trunk/busybox/coreutils/test.c
   trunk/busybox/coreutils/uniq.c
   trunk/busybox/include/libbb.h
   trunk/busybox/libbb/dump.c
   trunk/busybox/libbb/inet_common.c
   trunk/busybox/libbb/pw_encrypt.c
   trunk/busybox/libbb/skip_whitespace.c
   trunk/busybox/libpwdgrp/pwd_grp.c
   trunk/busybox/networking/libiproute/ll_proto.c
   trunk/busybox/util-linux/hexdump.c


Changeset:
Modified: trunk/busybox/applets/applets.c
===================================================================
--- trunk/busybox/applets/applets.c	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/applets/applets.c	2006-06-18 20:20:07 UTC (rev 15420)
@@ -14,8 +14,6 @@
 
 #include "busybox.h"
 #include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 #include <assert.h>
 
@@ -43,7 +41,6 @@
 
 #ifdef CONFIG_FEATURE_SUID_CONFIG
 
-#include <sys/stat.h>
 #include <ctype.h>
 #include "pwd_.h"
 #include "grp_.h"
@@ -99,7 +96,7 @@
 
 	/* Next, advance past all leading space and return a ptr to the
 	 * first non-space char; possibly the terminating nul. */
-	return (char *) bb_skip_whitespace(s);
+	return skip_whitespace(s);
 }
 
 
@@ -240,7 +237,7 @@
 
 				/* Get the specified mode. */
 
-				e = (char *) bb_skip_whitespace(e+1);
+				e = skip_whitespace(e+1);
 
 				for (i=0 ; i < 3 ; i++) {
 					const char *q;
@@ -253,7 +250,7 @@
 
 				/* Now get the the user/group info. */
 
-				s = (char *) bb_skip_whitespace(e);
+				s = skip_whitespace(e);
 
 				/* Note: We require whitespace between the mode and the
 				 * user/group info. */

Modified: trunk/busybox/coreutils/ls.c
===================================================================
--- trunk/busybox/coreutils/ls.c	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/coreutils/ls.c	2006-06-18 20:20:07 UTC (rev 15420)
@@ -36,32 +36,18 @@
 
 /************************************************************************/
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
+#include "busybox.h"
 #include <unistd.h>
-#include <dirent.h>
 #include <errno.h>
-#include <stdio.h>
 #include <string.h>
-#include <stdlib.h>
 #include <fcntl.h>
 #include <signal.h>
-#include <termios.h>
 #include <getopt.h> /* struct option */
 #include <sys/ioctl.h>
 #include <sys/sysmacros.h>     /* major() and minor() */
-#include "busybox.h"
-#ifdef CONFIG_SELINUX
-#include <selinux/selinux.h>   /* for is_selinux_enabled() */
-#endif
-
-#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
 #include <time.h>
-#endif
 
 /* what is the overall style of the listing */
-#define STYLE_AUTO      (0)
 #define STYLE_COLUMNS   (1U<<21)	/* fill columns */
 #define STYLE_LONG      (2U<<21)	/* one record per line, extended info */
 #define STYLE_SINGLE    (3U<<21)	/* one record per line */
@@ -99,7 +85,7 @@
 
 #define DISP_MASK       (((DISP_ROWS << 1) - 1) & ~(DISP_DIRNAME - 1))
 
-#ifdef CONFIG_FEATURE_LS_SORTFILES
+// CONFIG_FEATURE_LS_SORTFILES
 /* how will the files be sorted */
 #define SORT_ORDER_FORWARD   0		/* sort in reverse order */
 #define SORT_ORDER_REVERSE   (1U<<27)	/* sort in reverse order */
@@ -114,7 +100,6 @@
 #define SORT_DIR       (7U<<28)		/* sort by file or directory */
 
 #define SORT_MASK      (7U<<28)
-#endif
 
 #ifdef CONFIG_FEATURE_LS_TIMESTAMPS
 /* which of the three times will be used */
@@ -416,11 +401,8 @@
 
 	if (dif == 0) {
 		/* sort by name- may be a tie_breaker for time or size cmp */
-#ifdef CONFIG_LOCALE_SUPPORT
-		dif = strcoll(d1->name, d2->name);
-#else
-		dif = strcmp(d1->name, d2->name);
-#endif
+		if (ENABLE_LOCALE_SUPPORT) dif = strcoll(d1->name, d2->name);
+		else dif = strcmp(d1->name, d2->name);
 	}
 
 	if (all_fmt & SORT_ORDER_REVERSE) {
@@ -434,8 +416,12 @@
 {
 	qsort(dn, size, sizeof *dn, sortcmp);
 }
+#else
+#define sortcmp(a, b) 0
+#define dnsort(dn, size)
 #endif
 
+
 /*----------------------------------------------------------------------*/
 static void showfiles(struct dnode **dn, int nfiles)
 {
@@ -502,11 +488,8 @@
 {
 	int i, nfiles;
 	struct dnode **subdnp;
-
-#ifdef CONFIG_FEATURE_LS_RECURSIVE
 	int dndirs;
 	struct dnode **dnd;
-#endif
 
 	if (dn == NULL || ndirs < 1)
 		return;
@@ -522,9 +505,7 @@
 		nfiles = countfiles(subdnp);
 		if (nfiles > 0) {
 			/* list all files at this level */
-#ifdef CONFIG_FEATURE_LS_SORTFILES
-			dnsort(subdnp, nfiles);
-#endif
+			if (ENABLE_FEATURE_LS_SORTFILES) dnsort(subdnp, nfiles);
 			showfiles(subdnp, nfiles);
 #ifdef CONFIG_FEATURE_LS_RECURSIVE
 			if (all_fmt & DISP_RECURSIVE) {
@@ -532,9 +513,7 @@
 				dnd = splitdnarray(subdnp, nfiles, SPLIT_SUBDIR);
 				dndirs = countsubdirs(subdnp, nfiles);
 				if (dndirs > 0) {
-#ifdef CONFIG_FEATURE_LS_SORTFILES
-					dnsort(dnd, dndirs);
-#endif
+					if (ENABLE_FEATURE_LS_SORTFILES) dnsort(dnd, dndirs);
 					showdirs(dnd, dndirs, 0);
 					free(dnd);	/* free the array of dnode pointers to the dirs */
 				}
@@ -796,12 +775,6 @@
 # define LS_STR_TIMESTAMPS	""
 #endif
 
-#ifdef CONFIG_FEATURE_LS_SORTFILES
-# define LS_STR_SORTFILES	"SXrv"
-#else
-# define LS_STR_SORTFILES	""
-#endif
-
 #ifdef CONFIG_FEATURE_LS_FILETYPES
 # define LS_STR_FILETYPES	"Fp"
 #else
@@ -840,7 +813,7 @@
 
 static const char ls_options[]="Cadil1gnsxAk" \
 	LS_STR_TIMESTAMPS \
-	LS_STR_SORTFILES \
+	USE_FEATURE_LS_SORTFILES("SXrv") \
 	LS_STR_FILETYPES \
 	LS_STR_FOLLOW_LINKS \
 	LS_STR_RECURSIVE \
@@ -872,22 +845,10 @@
 	0,							/* k - ingored */
 #endif
 #ifdef CONFIG_FEATURE_LS_TIMESTAMPS
-# ifdef CONFIG_FEATURE_LS_SORTFILES
-	TIME_CHANGE | SORT_CTIME,	/* c */
-# else
-	TIME_CHANGE,				/* c */
-# endif
+	TIME_CHANGE | (ENABLE_FEATURE_LS_SORTFILES * SORT_CTIME),	/* c */
 	LIST_FULLTIME,				/* e */
-# ifdef CONFIG_FEATURE_LS_SORTFILES
-	SORT_MTIME,					/* t */
-# else
-	0,							/* t - ignored -- is this correct? */
-# endif
-# ifdef CONFIG_FEATURE_LS_SORTFILES
-	TIME_ACCESS | SORT_ATIME,	/* u */
-# else
-	TIME_ACCESS,				/* u */
-# endif
+	ENABLE_FEATURE_LS_SORTFILES * SORT_MTIME,	/* t */
+	TIME_ACCESS | (ENABLE_FEATURE_LS_SORTFILES * SORT_ATIME),	/* u */
 #endif
 #ifdef CONFIG_FEATURE_LS_SORTFILES
 	SORT_SIZE,					/* S */
@@ -943,14 +904,8 @@
 	char *color_opt;
 #endif
 
-	all_fmt = LIST_SHORT | STYLE_AUTO
-#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
-		| TIME_MOD
-#endif
-#ifdef CONFIG_FEATURE_LS_SORTFILES
-		| SORT_NAME | SORT_ORDER_FORWARD
-#endif
-		;
+	all_fmt = LIST_SHORT | (ENABLE_FEATURE_LS_TIMESTAMPS * TIME_MOD) |
+		(ENABLE_FEATURE_LS_SORTFILES * (SORT_NAME | SORT_ORDER_FORWARD));
 
 #ifdef CONFIG_FEATURE_AUTOWIDTH
 	/* Obtain the terminal width.  */
@@ -993,11 +948,9 @@
 			if (flags & STYLE_MASK_TRIGGER) {
 				all_fmt &= ~STYLE_MASK;
 			}
-#ifdef CONFIG_FEATURE_LS_SORTFILES
-			if (flags & SORT_MASK_TRIGGER) {
+			if (ENABLE_FEATURE_LS_SORTFILES && (flags & SORT_MASK_TRIGGER)) {
 				all_fmt &= ~SORT_MASK;
 			}
-#endif
 			if (flags & DISP_MASK_TRIGGER) {
 				all_fmt &= ~DISP_MASK;
 			}
@@ -1049,12 +1002,12 @@
 	if (all_fmt & DISP_NOLIST)
 		all_fmt &= ~DISP_RECURSIVE;	/* no recurse if listing only dir */
 #endif
-#if defined (CONFIG_FEATURE_LS_TIMESTAMPS) && defined (CONFIG_FEATURE_LS_SORTFILES)
-	if (all_fmt & TIME_CHANGE)
-		all_fmt = (all_fmt & ~SORT_MASK) | SORT_CTIME;
-	if (all_fmt & TIME_ACCESS)
-		all_fmt = (all_fmt & ~SORT_MASK) | SORT_ATIME;
-#endif
+	if (ENABLE_FEATURE_LS_TIMESTAMPS && ENABLE_FEATURE_LS_SORTFILES) {
+		if (all_fmt & TIME_CHANGE)
+			all_fmt = (all_fmt & ~SORT_MASK) | SORT_CTIME;
+		if (all_fmt & TIME_ACCESS)
+			all_fmt = (all_fmt & ~SORT_MASK) | SORT_ATIME;
+	}
 	if ((all_fmt & STYLE_MASK) != STYLE_LONG) /* only for long list */
 		all_fmt &= ~(LIST_ID_NUMERIC|LIST_FULLTIME|LIST_ID_NAME|LIST_ID_NUMERIC);
 #ifdef CONFIG_FEATURE_LS_USERNAME
@@ -1063,13 +1016,8 @@
 #endif
 
 	/* choose a display format */
-	if ((all_fmt & STYLE_MASK) == STYLE_AUTO)
-#if STYLE_AUTO != 0
-		all_fmt = (all_fmt & ~STYLE_MASK)
-				| (isatty(STDOUT_FILENO) ? STYLE_COLUMNS : STYLE_SINGLE);
-#else
+	if (!(all_fmt & STYLE_MASK))
 		all_fmt |= (isatty(STDOUT_FILENO) ? STYLE_COLUMNS : STYLE_SINGLE);
-#endif
 
 	/*
 	 * when there are no cmd line args we have to supply a default "." arg.
@@ -1114,9 +1062,7 @@
 	}
 
 	if (all_fmt & DISP_NOLIST) {
-#ifdef CONFIG_FEATURE_LS_SORTFILES
-		dnsort(dnp, nfiles);
-#endif
+		if (ENABLE_FEATURE_LS_SORTFILES) dnsort(dnp, nfiles);
 		if (nfiles > 0)
 			showfiles(dnp, nfiles);
 	} else {
@@ -1125,17 +1071,13 @@
 		dndirs = countdirs(dnp, nfiles);
 		dnfiles = nfiles - dndirs;
 		if (dnfiles > 0) {
-#ifdef CONFIG_FEATURE_LS_SORTFILES
-			dnsort(dnf, dnfiles);
-#endif
+			if (ENABLE_FEATURE_LS_SORTFILES) dnsort(dnf, dnfiles);
 			showfiles(dnf, dnfiles);
 			if (ENABLE_FEATURE_CLEAN_UP)
 				free(dnf);
 		}
 		if (dndirs > 0) {
-#ifdef CONFIG_FEATURE_LS_SORTFILES
-			dnsort(dnd, dndirs);
-#endif
+			if (ENABLE_FEATURE_LS_SORTFILES) dnsort(dnd, dndirs);
 			showdirs(dnd, dndirs, dnfiles == 0);
 			if (ENABLE_FEATURE_CLEAN_UP)
 				free(dnd);

Modified: trunk/busybox/coreutils/test.c
===================================================================
--- trunk/busybox/coreutils/test.c	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/coreutils/test.c	2006-06-18 20:20:07 UTC (rev 15420)
@@ -19,14 +19,12 @@
  *     "This program is in the Public Domain."
  */
 
-#include <sys/types.h>
+#include "busybox.h"
 #include <unistd.h>
 #include <ctype.h>
 #include <errno.h>
-#include <stdlib.h>
 #include <string.h>
 #include <setjmp.h>
-#include "busybox.h"
 
 /* test(1) accepts the following grammar:
 	oexpr	::= aexpr | aexpr "-o" oexpr ;
@@ -482,8 +480,7 @@
 	if (errno != 0)
 		syntax(s, "out of range");
 
-	/*   p = bb_skip_whitespace(p); avoid const warning */
-	if (*(bb_skip_whitespace(p)))
+	if (*(skip_whitespace(p)))
 		syntax(s, "bad number");
 
 	return r;

Modified: trunk/busybox/coreutils/uniq.c
===================================================================
--- trunk/busybox/coreutils/uniq.c	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/coreutils/uniq.c	2006-06-18 20:20:07 UTC (rev 15420)
@@ -10,12 +10,10 @@
 /* BB_AUDIT SUSv3 compliant */
 /* http://www.opengroup.org/onlinepubs/007904975/utilities/uniq.html */
 
-#include <stdio.h>
-#include <stdlib.h>
+#include "busybox.h"
 #include <string.h>
 #include <ctype.h>
 #include <unistd.h>
-#include "busybox.h"
 
 static const char uniq_opts[] = "f:s:" "cdu\0\1\2\4";
 
@@ -77,7 +75,7 @@
 		while ((s1 = bb_get_chomped_line_from_file(in)) != NULL) {
 			e1 = s1;
 			for (i=skip_fields ; i ; i--) {
-				e1 = bb_skip_whitespace(e1);
+				e1 = skip_whitespace(e1);
 				while (*e1 && !isspace(*e1)) {
 					++e1;
 				}

Modified: trunk/busybox/include/libbb.h
===================================================================
--- trunk/busybox/include/libbb.h	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/include/libbb.h	2006-06-18 20:20:07 UTC (rev 15420)
@@ -200,7 +200,7 @@
 
 extern void chomp(char *s);
 extern void trim(char *s);
-extern const char *bb_skip_whitespace(const char *);
+extern char *skip_whitespace(const char *);
 
 extern struct BB_applet *find_applet_by_name(const char *name);
 void run_applet_by_name(const char *name, int argc, char **argv);

Modified: trunk/busybox/libbb/dump.c
===================================================================
--- trunk/busybox/libbb/dump.c	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/libbb/dump.c	2006-06-18 20:20:07 UTC (rev 15420)
@@ -10,11 +10,10 @@
  * Original copyright notice is retained at the end of this file.
  */
 
-#include <stdlib.h>
+#include "libbb.h"
 #include <string.h>
 #include <unistd.h>
 #include <ctype.h>		/* for isdigit() */
-#include "libbb.h"
 #include "dump.h"
 
 enum _vflag bb_dump_vflag = FIRST;
@@ -83,9 +82,9 @@
 static void rewrite(FS * fs)
 {
 	enum { NOTOKAY, USEBCNT, USEPREC } sokay;
-	register PR *pr, **nextpr = NULL;
-	register FU *fu;
-	register char *p1, *p2, *p3;
+	PR *pr, **nextpr = NULL;
+	FU *fu;
+	char *p1, *p2, *p3;
 	char savech, *fmtp;
 	const char *byte_count_str;
 	int nconv, prec = 0;
@@ -98,7 +97,7 @@
 		for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) {
 			/* NOSTRICT */
 			/* DBU:[dvae at cray.com] calloc so that forward ptrs start out NULL*/
-			pr = (PR *) xzalloc(sizeof(PR));
+			pr = xzalloc(sizeof(PR));
 			if (!fu->nextpr)
 				fu->nextpr = pr;
 			/* ignore nextpr -- its unused inside the loop and is
@@ -246,8 +245,7 @@
 			{
 				savech = *p3;
 				*p3 = '\0';
-				if (!(pr->fmt = realloc(pr->fmt, strlen(pr->fmt)+(p3-p2)+1)))
-					bb_perror_msg_and_die("hexdump");
+				pr->fmt = xrealloc(pr->fmt, strlen(pr->fmt)+(p3-p2)+1);
 				strcat(pr->fmt, p2);
 				*p3 = savech;
 				p2 = p3;
@@ -673,17 +671,16 @@
 
 void bb_dump_add(const char *fmt)
 {
-	register const char *p;
-	register char *p1;
-	register char *p2;
+	const char *p;
+	char *p1;
+	char *p2;
 	static FS **nextfs;
 	FS *tfs;
 	FU *tfu, **nextfu;
 	const char *savep;
 
 	/* start new linked list of format units */
-	/* NOSTRICT */
-	tfs = (FS *) xzalloc(sizeof(FS)); /*DBU:[dave at cray.com] start out NULL */
+	tfs = xzalloc(sizeof(FS)); /*DBU:[dave at cray.com] start out NULL */
 	if (!bb_dump_fshead) {
 		bb_dump_fshead = tfs;
 	} else {
@@ -695,7 +692,7 @@
 	/* take the format string and break it up into format units */
 	for (p = fmt;;) {
 		/* bb_dump_skip leading white space */
-		p = bb_skip_whitespace(p);
+		p = skip_whitespace(p);
 		if (!*p) {
 			break;
 		}
@@ -703,7 +700,7 @@
 		/* allocate a new format unit and link it in */
 		/* NOSTRICT */
 		/* DBU:[dave at cray.com] calloc so that forward pointers start out NULL */
-		tfu = (FU *) xzalloc(sizeof(FU));
+		tfu = xzalloc(sizeof(FU));
 		*nextfu = tfu;
 		nextfu = &tfu->nextfu;
 		tfu->reps = 1;
@@ -718,12 +715,12 @@
 			tfu->reps = atoi(savep);
 			tfu->flags = F_SETREP;
 			/* bb_dump_skip trailing white space */
-			p = bb_skip_whitespace(++p);
+			p = skip_whitespace(++p);
 		}
 
 		/* bb_dump_skip slash and trailing white space */
 		if (*p == '/') {
-			p = bb_skip_whitespace(++p);
+			p = skip_whitespace(++p);
 		}
 
 		/* byte count */
@@ -734,7 +731,7 @@
 			}
 			tfu->bcnt = atoi(savep);
 			/* bb_dump_skip trailing white space */
-			p = bb_skip_whitespace(++p);
+			p = skip_whitespace(++p);
 		}
 
 		/* format */

Modified: trunk/busybox/libbb/inet_common.c
===================================================================
--- trunk/busybox/libbb/inet_common.c	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/libbb/inet_common.c	2006-06-18 20:20:07 UTC (rev 15420)
@@ -8,13 +8,13 @@
  *
  */
 
+#include "libbb.h"
 #include "inet_common.h"
 #include <stdio.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include "libbb.h"
 
 #ifdef DEBUG
 # include <resolv.h>

Modified: trunk/busybox/libbb/pw_encrypt.c
===================================================================
--- trunk/busybox/libbb/pw_encrypt.c	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/libbb/pw_encrypt.c	2006-06-18 20:20:07 UTC (rev 15420)
@@ -20,9 +20,9 @@
  *
  */
 
+#include "libbb.h"
 #include <string.h>
 #include <crypt.h>
-#include "libbb.h"
 
 
 char *pw_encrypt(const char *clear, const char *salt)

Modified: trunk/busybox/libbb/skip_whitespace.c
===================================================================
--- trunk/busybox/libbb/skip_whitespace.c	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/libbb/skip_whitespace.c	2006-06-18 20:20:07 UTC (rev 15420)
@@ -4,30 +4,15 @@
  *
  * Copyright (C) 2003  Manuel Novoa III  <mjn3 at codepoet.org>
  *
- * 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
- *
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
 #include <ctype.h>
 #include "libbb.h"
 
-const char *bb_skip_whitespace(const char *s)
+char *skip_whitespace(const char *s)
 {
-	while (isspace(*s)) {
-		++s;
-	}
+	while (isspace(*s)) ++s;
 
-	return s;
+	return (char *) s;
 }

Modified: trunk/busybox/libpwdgrp/pwd_grp.c
===================================================================
--- trunk/busybox/libpwdgrp/pwd_grp.c	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/libpwdgrp/pwd_grp.c	2006-06-18 20:20:07 UTC (rev 15420)
@@ -17,6 +17,7 @@
  *
  */
 
+#include "libbb.h"
 #include <features.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -27,10 +28,9 @@
 #include <assert.h>
 #include <ctype.h>
 
-#include "pwd_.h"
-#include "grp_.h"
-#include "shadow_.h"
-#include "libbb.h"
+//#include "pwd_.h"
+//#include "grp_.h"
+//#include "shadow_.h"
 
 #ifndef _PATH_SHADOW
 #define	_PATH_SHADOW	"/etc/shadow"

Modified: trunk/busybox/networking/libiproute/ll_proto.c
===================================================================
--- trunk/busybox/networking/libiproute/ll_proto.c	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/networking/libiproute/ll_proto.c	2006-06-18 20:20:07 UTC (rev 15420)
@@ -9,8 +9,7 @@
  * Authors:	Alexey Kuznetsov, <kuznet at ms2.inr.ac.ru>
  */
 
-#include <stdio.h>
-#include <arpa/inet.h>
+#include "libbb.h"
 #include <string.h>
 
 #include "rt_names.h"

Modified: trunk/busybox/util-linux/hexdump.c
===================================================================
--- trunk/busybox/util-linux/hexdump.c	2006-06-18 15:23:13 UTC (rev 15419)
+++ trunk/busybox/util-linux/hexdump.c	2006-06-18 20:20:07 UTC (rev 15420)
@@ -5,27 +5,12 @@
  * Copyright (c) 1989
  *	The Regents of the University of California.  All rights reserved.
  *
- * 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
- *
- * Original copyright notice is retained at the end of this file.
+ * Licensed under GPLv2 or later, see file License in this tarball for details.
  */
 
+#include "busybox.h"
 #include <getopt.h>
-#include <stdlib.h>
 #include <string.h>
-#include "busybox.h"
 #include "dump.h"
 
 static void bb_dump_addfile(char *name)
@@ -37,7 +22,7 @@
 	fp = bb_xfopen(name, "r");
 
 	while ((buf = bb_get_chomped_line_from_file(fp)) != NULL) {
-		p = (char *) bb_skip_whitespace(buf);
+		p = skip_whitespace(buf);
 
 		if (*p && (*p != '#')) {
 			bb_dump_add(p);
@@ -116,31 +101,3 @@
 
 	return(bb_dump_dump(argv));
 }
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */




More information about the busybox-cvs mailing list