summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-09-06 02:31:16 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2011-09-06 02:31:16 (GMT)
commited058016bf8fc98271de2e58bfb650de9e9d304d (patch)
treeb6554880a7224a86c27429aaebfa6a5b16349b59
parentcc272b06eefb87030bb85b686abdbc22b5ed1c34 (diff)
downloadbusybox-ed058016bf8fc98271de2e58bfb650de9e9d304d.tar.gz
busybox-ed058016bf8fc98271de2e58bfb650de9e9d304d.tar.bz2
Apply post-1.19.1 patches, bump version to 1.19.21_19_2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--Makefile2
-rw-r--r--editors/patch.c8
-rw-r--r--libbb/lineedit.c2
-rw-r--r--libbb/match_fstype.c4
-rw-r--r--shell/hush.c18
5 files changed, 18 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 138d1d4..2cac36c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION = 1
PATCHLEVEL = 19
-SUBLEVEL = 1
+SUBLEVEL = 2
EXTRAVERSION =
NAME = Unnamed
diff --git a/editors/patch.c b/editors/patch.c
index ec5b8e7..1f2a49b 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -70,8 +70,7 @@ struct double_list {
// Free all the elements of a linked list
// Call freeit() on each element before freeing it.
-static
-void dlist_free(struct double_list *list, void (*freeit)(void *data))
+static void dlist_free(struct double_list *list, void (*freeit)(void *data))
{
while (list) {
void *pop = list;
@@ -83,8 +82,7 @@ void dlist_free(struct double_list *list, void (*freeit)(void *data))
}
// Add an entry before "list" element in (circular) doubly linked list
-static
-struct double_list *dlist_add(struct double_list **list, char *data)
+static struct double_list *dlist_add(struct double_list **list, char *data)
{
struct double_list *llist;
struct double_list *line = xmalloc(sizeof(*line));
@@ -232,7 +230,7 @@ static int apply_one_hunk(void)
else matcheof = 0;
if (PATCH_DEBUG) fdprintf(2, "HUNK:%s\n", plist->data);
}
- matcheof = matcheof < TT.context;
+ matcheof = !matcheof || matcheof < TT.context;
if (PATCH_DEBUG) fdprintf(2,"MATCHEOF=%c\n", matcheof ? 'Y' : 'N');
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 1026519..2ea373c 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1425,7 +1425,7 @@ static void save_history(char *str)
/* write out temp file and replace hist_file atomically */
new_name = xasprintf("%s.%u.new", state->hist_file, (int) getpid());
- fd = open(state->hist_file, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ fd = open(new_name, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (fd >= 0) {
FILE *fp;
int i;
diff --git a/libbb/match_fstype.c b/libbb/match_fstype.c
index c792d13..32c3d7f 100644
--- a/libbb/match_fstype.c
+++ b/libbb/match_fstype.c
@@ -10,10 +10,10 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
-#ifdef HAVE_MNTENT_H
-
#include "libbb.h"
+#ifdef HAVE_MNTENT_H
+
int FAST_FUNC match_fstype(const struct mntent *mt, const char *t_fstype)
{
int match = 1;
diff --git a/shell/hush.c b/shell/hush.c
index e4138ad..de0af9c 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -7817,20 +7817,24 @@ int hush_main(int argc, char **argv)
#if ENABLE_FEATURE_EDITING
G.line_input_state = new_line_input_t(FOR_SHELL);
-# if defined MAX_HISTORY && MAX_HISTORY > 0 && ENABLE_HUSH_SAVEHISTORY
+# if MAX_HISTORY > 0 && ENABLE_HUSH_SAVEHISTORY
{
const char *hp = get_local_var_value("HISTFILE");
if (!hp) {
hp = get_local_var_value("HOME");
- if (hp) {
- G.line_input_state->hist_file = concat_path_file(hp, ".hush_history");
- //set_local_var(xasprintf("HISTFILE=%s", ...));
- }
+ if (hp)
+ hp = concat_path_file(hp, ".hush_history");
+ } else {
+ hp = xstrdup(hp);
}
-# if ENABLE_FEATURE_SH_HISTFILESIZE
+ if (hp) {
+ G.line_input_state->hist_file = hp;
+ //set_local_var(xasprintf("HISTFILE=%s", ...));
+ }
+# if ENABLE_FEATURE_SH_HISTFILESIZE
hp = get_local_var_value("HISTFILESIZE");
G.line_input_state->max_history = size_from_HISTFILESIZE(hp);
-# endif
+# endif
}
# endif
#endif