svn commit: branches/busybox_1_12_stable: libbb

vda at busybox.net vda at busybox.net
Sat Nov 29 06:43:06 UTC 2008


Author: vda
Date: 2008-11-28 22:43:05 -0800 (Fri, 28 Nov 2008)
New Revision: 24174

Log:
apply post-1.12.2 fixes, bump version to 1.12.3



Modified:
   branches/busybox_1_12_stable/Makefile
   branches/busybox_1_12_stable/libbb/getopt32.c
   branches/busybox_1_12_stable/libbb/lineedit.c


Changeset:
Modified: branches/busybox_1_12_stable/Makefile
===================================================================
--- branches/busybox_1_12_stable/Makefile	2008-11-28 14:20:47 UTC (rev 24173)
+++ branches/busybox_1_12_stable/Makefile	2008-11-29 06:43:05 UTC (rev 24174)
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 12
-SUBLEVEL = 2
+SUBLEVEL = 3
 EXTRAVERSION =
 NAME = Unnamed
 

Modified: branches/busybox_1_12_stable/libbb/getopt32.c
===================================================================
--- branches/busybox_1_12_stable/libbb/getopt32.c	2008-11-28 14:20:47 UTC (rev 24173)
+++ branches/busybox_1_12_stable/libbb/getopt32.c	2008-11-29 06:43:05 UTC (rev 24174)
@@ -515,6 +515,19 @@
 		}
 	}
 
+	/* In case getopt32 was already called:
+	 * reset the libc getopt() function, which keeps internal state.
+	 * run_nofork_applet_prime() does this, but we might end up here
+	 * also via gunzip_main() -> gzip_main(). Play safe.
+	 */
+#ifdef __GLIBC__
+	optind = 0;
+#else /* BSD style */
+	optind = 1;
+	/* optreset = 1; */
+#endif
+	/* optarg = NULL; opterr = 0; optopt = 0; - do we need this?? */
+
 	pargv = NULL;
 
 	/* Note: just "getopt() <= 0" will not work well for

Modified: branches/busybox_1_12_stable/libbb/lineedit.c
===================================================================
--- branches/busybox_1_12_stable/libbb/lineedit.c	2008-11-28 14:20:47 UTC (rev 24173)
+++ branches/busybox_1_12_stable/libbb/lineedit.c	2008-11-29 06:43:05 UTC (rev 24174)
@@ -1415,8 +1415,10 @@
 	if ((state->flags & SAVE_HISTORY) && state->hist_file)
 		load_history(state->hist_file);
 #endif
+#if MAX_HISTORY > 0
 	if (state->flags & DO_HISTORY)
 		state->cur_history = state->cnt_history;
+#endif
 
 	/* prepare before init handlers */
 	cmdedit_y = 0;  /* quasireal y, not true if line > xt*yt */




More information about the busybox-cvs mailing list