svn commit: trunk/busybox: coreutils loginutils scripts/config/lxdi etc...

vapier at busybox.net vapier at busybox.net
Sun Apr 16 05:54:32 UTC 2006


Author: vapier
Date: 2006-04-15 22:54:31 -0700 (Sat, 15 Apr 2006)
New Revision: 14885

Log:
use strchr() not index()

Modified:
   trunk/busybox/coreutils/sort.c
   trunk/busybox/loginutils/deluser.c
   trunk/busybox/scripts/config/lxdialog/util.c


Changeset:
Modified: trunk/busybox/coreutils/sort.c
===================================================================
--- trunk/busybox/coreutils/sort.c	2006-04-16 05:52:06 UTC (rev 14884)
+++ trunk/busybox/coreutils/sort.c	2006-04-16 05:54:31 UTC (rev 14885)
@@ -236,7 +236,7 @@
 	bb_default_error_retval = 2;
 	/* Parse command line options */
 	while((c=getopt(argc,argv,optlist))>0) {
-		line=index(optlist,c);
+		line=strchr(optlist,c);
 		if(!line) bb_show_usage();
 		switch(*line) {
 #ifdef CONFIG_FEATURE_SORT_BIG
@@ -267,7 +267,7 @@
 							break;
 						} /* no else needed: fall through to syntax error
 							 because comma isn't in optlist */
-						temp2=index(optlist,*temp);
+						temp2=strchr(optlist,*temp);
 						flag=(1<<(temp2-optlist));
 						if(!temp2 || (flag>FLAG_M && flag<FLAG_b))
 							bb_error_msg_and_die("Unknown key option.");

Modified: trunk/busybox/loginutils/deluser.c
===================================================================
--- trunk/busybox/loginutils/deluser.c	2006-04-16 05:52:06 UTC (rev 14884)
+++ trunk/busybox/loginutils/deluser.c	2006-04-16 05:54:31 UTC (rev 14885)
@@ -43,7 +43,7 @@
 	}
 	start++;
 
-	stop = index(start, '\n');	/* index is a BSD-ism */
+	stop = strchr(start, '\n');
 	b.start = start - buffer;
 	b.stop = stop - buffer;
 	return b;

Modified: trunk/busybox/scripts/config/lxdialog/util.c
===================================================================
--- trunk/busybox/scripts/config/lxdialog/util.c	2006-04-16 05:52:06 UTC (rev 14884)
+++ trunk/busybox/scripts/config/lxdialog/util.c	2006-04-16 05:54:31 UTC (rev 14885)
@@ -221,7 +221,7 @@
 	newl = 1;
 	word = tempstr;
 	while (word && *word) {
-	    sp = index(word, ' ');
+	    sp = strchr(word, ' ');
 	    if (sp)
 	        *sp++ = 0;
 
@@ -232,7 +232,7 @@
 	    wlen = strlen(word);
 	    if (wlen > room ||
 	       (newl && wlen < 4 && sp && wlen+1+strlen(sp) > room
-		     && (!(sp2 = index(sp, ' ')) || wlen+1+(sp2-sp) > room))) {
+		     && (!(sp2 = strchr(sp, ' ')) || wlen+1+(sp2-sp) > room))) {
 		cur_y++;
 		cur_x = x;
 	    }




More information about the busybox-cvs mailing list