update to 4.7.4 (#630900)
This commit is contained in:
parent
92144a5e41
commit
faaa343704
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
mc-4.7.3.tar.lzma
|
||||
mc-4.7.4.tar.lzma
|
||||
|
@ -1,12 +0,0 @@
|
||||
diff -up mc-4.7.3/src/achown.c.achownsegfault mc-4.7.3/src/achown.c
|
||||
--- mc-4.7.3/src/achown.c.achownsegfault 2010-07-05 20:32:41.000000000 +0200
|
||||
+++ mc-4.7.3/src/achown.c 2010-09-01 10:41:15.773738062 +0200
|
||||
@@ -498,7 +498,7 @@ advanced_chown_callback (Dlg_head *h, Wi
|
||||
if (f_pos > 2)
|
||||
break;
|
||||
flag_pos = f_pos * 3 + i; /* (strchr(ch_perm,parm)-ch_perm); */
|
||||
- if (((WButton *) h->current)->text.start[(flag_pos % 3)] ==
|
||||
+ if (((WButton *) h->current->data)->text.start[(flag_pos % 3)] ==
|
||||
'-')
|
||||
ch_flags[flag_pos] = '+';
|
||||
else
|
@ -1,38 +0,0 @@
|
||||
diff --git a/src/file.c b/src/file.c
|
||||
index d7eaa46..5c45dcf 100644
|
||||
--- a/src/file.c
|
||||
+++ b/src/file.c
|
||||
@@ -2066,28 +2066,21 @@ panel_operate (void *source_panel, FileOperation operation, gboolean force_singl
|
||||
dest_dir = other_panel->cwd;
|
||||
else
|
||||
dest_dir = panel->cwd;
|
||||
-
|
||||
/*
|
||||
* Add trailing backslash only when do non-local ops.
|
||||
* It saves user from occasional file renames (when destination
|
||||
* dir is deleted)
|
||||
*/
|
||||
- if (force_single || dest_dir[0] == '\0')
|
||||
- {
|
||||
- /* just copy */
|
||||
- dest_dir_ = g_strdup (dest_dir);
|
||||
- }
|
||||
- else if (single_entry)
|
||||
+ if (!force_single && dest_dir[0] != '\0' && dest_dir[strlen (dest_dir) - 1] != PATH_SEP)
|
||||
{
|
||||
- /* add filename to dest path */
|
||||
- dest_dir_ = g_build_filename (dest_dir, source, (char *) NULL);
|
||||
+ /* add trailing separator */
|
||||
+ dest_dir_ = g_strconcat (dest_dir, PATH_SEP_STR, (char *) NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
- /* add trailing separator */
|
||||
- dest_dir_ = g_strconcat (dest_dir, PATH_SEP_STR, (char *) NULL);
|
||||
+ /* just copy */
|
||||
+ dest_dir_ = g_strdup (dest_dir);
|
||||
}
|
||||
-
|
||||
if (dest_dir_ == NULL)
|
||||
{
|
||||
file_op_total_context_destroy (tctx);
|
@ -1,82 +0,0 @@
|
||||
diff -up mc-4.7.3/lib/search/glob.c.dirname mc-4.7.3/lib/search/glob.c
|
||||
--- mc-4.7.3/lib/search/glob.c.dirname 2010-07-05 20:32:41.000000000 +0200
|
||||
+++ mc-4.7.3/lib/search/glob.c 2010-09-02 17:21:07.174555656 +0200
|
||||
@@ -118,14 +118,25 @@ mc_search__translate_replace_glob_to_reg
|
||||
{
|
||||
GString *buff = g_string_new ("");
|
||||
int cnt = '0';
|
||||
-
|
||||
+ gboolean escaped_mode = FALSE;
|
||||
while (*str) {
|
||||
char c = *str++;
|
||||
switch (c) {
|
||||
+ case '\\':
|
||||
+ if (!escaped_mode)
|
||||
+ {
|
||||
+ escaped_mode = TRUE;
|
||||
+ }
|
||||
+ g_string_append_c (buff, c);
|
||||
+ continue;
|
||||
case '*':
|
||||
case '?':
|
||||
+ if (!escaped_mode)
|
||||
+ {
|
||||
g_string_append_c (buff, '\\');
|
||||
c = ++cnt;
|
||||
+ continue;
|
||||
+ }
|
||||
break;
|
||||
/* breaks copying: mc uses "\0" internally, it must not be changed */
|
||||
/*case '\\':*/
|
||||
@@ -134,6 +145,7 @@ mc_search__translate_replace_glob_to_reg
|
||||
break;
|
||||
}
|
||||
g_string_append_c (buff, c);
|
||||
+ escaped_mode = FALSE;
|
||||
}
|
||||
return buff;
|
||||
}
|
||||
@@ -170,7 +182,6 @@ mc_search__run_glob (mc_search_t * lc_mc
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
-
|
||||
GString *
|
||||
mc_search_glob_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str)
|
||||
{
|
||||
diff -up mc-4.7.3/lib/search/regex.c.dirname mc-4.7.3/lib/search/regex.c
|
||||
--- mc-4.7.3/lib/search/regex.c.dirname 2010-07-05 20:32:41.000000000 +0200
|
||||
+++ mc-4.7.3/lib/search/regex.c 2010-09-02 17:19:26.836553568 +0200
|
||||
@@ -320,7 +320,7 @@ mc_search_regex__get_max_num_of_replace_
|
||||
gsize loop;
|
||||
for (loop = 0; loop < len - 1; loop++)
|
||||
{
|
||||
- if (str[loop] == '\\' && (str[loop + 1] & (char) 0xf0) == 0x30 /* 0-9 */ )
|
||||
+ if (str[loop] == '\\' && g_ascii_isdigit(str[loop + 1]) )
|
||||
{
|
||||
if (strutils_is_char_escaped (str, &str[loop]))
|
||||
continue;
|
||||
@@ -421,9 +421,9 @@ mc_search_regex__process_replace_str (co
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if ((*(curr_str + 1) & (char) 0xf0) == 0x30)
|
||||
+ if ( g_ascii_isdigit(*(curr_str + 1)))
|
||||
{
|
||||
- ret = *(curr_str + 1) - '0';
|
||||
+ ret = g_ascii_digit_value (*(curr_str + 1));
|
||||
*skip_len = 2; /* \\ and one digit */
|
||||
return ret;
|
||||
}
|
||||
diff -up mc-4.7.3/lib/strutil/strescape.c.dirname mc-4.7.3/lib/strutil/strescape.c
|
||||
--- mc-4.7.3/lib/strutil/strescape.c.dirname 2010-07-05 20:32:41.000000000 +0200
|
||||
+++ mc-4.7.3/lib/strutil/strescape.c 2010-09-02 17:19:26.835554197 +0200
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
static const char ESCAPE_SHELL_CHARS[] = " !#$%()&{}[]`?|<>;*\\\"'";
|
||||
static const char ESCAPE_REGEX_CHARS[] = "^!#$%()&{}[]`?|<>;*.\\";
|
||||
-static const char ESCAPE_GLOB_CHARS[] = "$*\\";
|
||||
+static const char ESCAPE_GLOB_CHARS[] = "$*\\?";
|
||||
|
||||
/*** file scope functions ************************************************************************/
|
||||
|
@ -1,30 +0,0 @@
|
||||
diff --git a/src/widget.c b/src/widget.c
|
||||
index 280575a..bf052cd 100644
|
||||
--- a/src/widget.c
|
||||
+++ b/src/widget.c
|
||||
@@ -1492,12 +1492,12 @@ show_hist (GList ** history, Widget * widget)
|
||||
entry->text = NULL;
|
||||
}
|
||||
|
||||
- destroy_dlg (query_dlg);
|
||||
-
|
||||
/* restore history direction */
|
||||
if (query_dlg->y < widget->y)
|
||||
z = g_list_reverse (z);
|
||||
|
||||
+ destroy_dlg (query_dlg);
|
||||
+
|
||||
g_list_foreach (*history, (GFunc) g_free, NULL);
|
||||
g_list_free (*history);
|
||||
*history = g_list_last (z);
|
||||
@@ -2751,9 +2751,7 @@ listbox_key (WListbox * l, int key)
|
||||
static inline void
|
||||
listbox_destroy (WListbox * l)
|
||||
{
|
||||
- /* don't delete list in modifable listbox */
|
||||
- if (!l->deletable)
|
||||
- listbox_remove_list (l);
|
||||
+ listbox_remove_list (l);
|
||||
}
|
||||
|
||||
static cb_ret_t
|
@ -1,110 +0,0 @@
|
||||
diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
|
||||
index 0e8bb1d..f568bdf 100644
|
||||
--- a/src/editor/editcmd.c
|
||||
+++ b/src/editor/editcmd.c
|
||||
@@ -1785,7 +1785,6 @@ edit_replace_cmd (WEdit * edit, int again)
|
||||
|
||||
if ((edit->search_start >= 0) && (edit->search_start < edit->last_byte))
|
||||
{
|
||||
- gboolean replace_yes;
|
||||
gsize i;
|
||||
|
||||
edit->found_start = edit->search_start;
|
||||
@@ -1794,11 +1793,11 @@ edit_replace_cmd (WEdit * edit, int again)
|
||||
edit_cursor_move (edit, edit->search_start - edit->curs1);
|
||||
edit_scroll_screen_over_cursor (edit);
|
||||
|
||||
- replace_yes = TRUE;
|
||||
-
|
||||
if (edit->replace_mode == 0)
|
||||
{
|
||||
int l;
|
||||
+ int prompt;
|
||||
+
|
||||
l = edit->curs_row - edit->num_widget_lines / 3;
|
||||
if (l > 0)
|
||||
edit_scroll_downward (edit, l);
|
||||
@@ -1814,52 +1813,49 @@ edit_replace_cmd (WEdit * edit, int again)
|
||||
/* and prompt 2/3 down */
|
||||
disp1 = edit_replace_cmd__conv_to_display (saved1);
|
||||
disp2 = edit_replace_cmd__conv_to_display (saved2);
|
||||
+ prompt = editcmd_dialog_replace_prompt_show (edit, disp1, disp2, -1, -1);
|
||||
+ g_free (disp1);
|
||||
+ g_free (disp2);
|
||||
|
||||
- switch (editcmd_dialog_replace_prompt_show (edit, disp1, disp2, -1, -1))
|
||||
- {
|
||||
- case B_ENTER:
|
||||
- replace_yes = TRUE;
|
||||
- break;
|
||||
- case B_SKIP_REPLACE:
|
||||
- replace_yes = FALSE;
|
||||
- break;
|
||||
- case B_REPLACE_ALL:
|
||||
+ if (prompt == B_REPLACE_ALL)
|
||||
edit->replace_mode = 1;
|
||||
- break;
|
||||
- case B_CANCEL:
|
||||
- replace_yes = FALSE;
|
||||
+ else if (prompt == B_SKIP_REPLACE)
|
||||
+ {
|
||||
+ if (edit_search_options.backwards)
|
||||
+ edit->search_start--;
|
||||
+ else
|
||||
+ edit->search_start++;
|
||||
+ continue; /* loop */
|
||||
+ }
|
||||
+ else if (prompt == B_CANCEL)
|
||||
+ {
|
||||
edit->replace_mode = -1;
|
||||
- break;
|
||||
+ break; /* loop */
|
||||
}
|
||||
- g_free (disp1);
|
||||
- g_free (disp2);
|
||||
}
|
||||
|
||||
- if (replace_yes)
|
||||
+ /* don't process string each time */
|
||||
+ if (tmp_str == NULL)
|
||||
{
|
||||
- /* don't process string each time */
|
||||
- if (tmp_str == NULL)
|
||||
- {
|
||||
- tmp_str = g_string_new (input2);
|
||||
- repl_str = mc_search_prepare_replace_str (edit->search, tmp_str);
|
||||
+ tmp_str = g_string_new (input2);
|
||||
+ repl_str = mc_search_prepare_replace_str (edit->search, tmp_str);
|
||||
|
||||
- if (edit->search->error != MC_SEARCH_E_OK)
|
||||
- {
|
||||
- edit_error_dialog (_("Replace"), edit->search->error_str);
|
||||
- break;
|
||||
- }
|
||||
+ if (edit->search->error != MC_SEARCH_E_OK)
|
||||
+ {
|
||||
+ edit_error_dialog (_("Replace"), edit->search->error_str);
|
||||
+ break;
|
||||
}
|
||||
+ }
|
||||
|
||||
- /* delete then insert new */
|
||||
- for (i = 0; i < len; i++)
|
||||
- edit_delete (edit, 1);
|
||||
+ /* delete then insert new */
|
||||
+ for (i = 0; i < len; i++)
|
||||
+ edit_delete (edit, 1);
|
||||
|
||||
- for (i = 0; i < repl_str->len; i++)
|
||||
- edit_insert (edit, repl_str->str[i]);
|
||||
+ for (i = 0; i < repl_str->len; i++)
|
||||
+ edit_insert (edit, repl_str->str[i]);
|
||||
|
||||
- edit->found_len = repl_str->len;
|
||||
- times_replaced++;
|
||||
- }
|
||||
+ edit->found_len = repl_str->len;
|
||||
+ times_replaced++;
|
||||
|
||||
/* so that we don't find the same string again */
|
||||
if (edit_search_options.backwards)
|
19
mc.spec
19
mc.spec
@ -1,7 +1,7 @@
|
||||
Summary: User-friendly text console file manager and visual shell
|
||||
Name: mc
|
||||
Version: 4.7.3
|
||||
Release: 4%{?dist}
|
||||
Version: 4.7.4
|
||||
Release: 1%{?dist}
|
||||
Epoch: 1
|
||||
License: GPLv2
|
||||
Group: System Environment/Shells
|
||||
@ -14,11 +14,6 @@ Requires: dev >= 3.3-3
|
||||
|
||||
Patch0: mc-extensions.patch
|
||||
Patch1: mc-mcviewsegfault.patch
|
||||
Patch2: mc-achownsegfault.patch
|
||||
Patch3: mc-dircopying.patch
|
||||
Patch4: mc-dirname.patch
|
||||
Patch5: mc-replacefix.patch
|
||||
Patch6: mc-historyfix.patch
|
||||
|
||||
%description
|
||||
Midnight Commander is a visual shell much like a file manager, only
|
||||
@ -31,14 +26,9 @@ specific files.
|
||||
%setup -q
|
||||
%patch0 -p1 -b .extensions
|
||||
%patch1 -p1 -b .mcviewsegfault
|
||||
%patch2 -p1 -b .achownsegfault
|
||||
%patch3 -p1 -b .dircopying
|
||||
%patch4 -p1 -b .dirname
|
||||
%patch5 -p1 -b .replacefix
|
||||
%patch6 -p1 -b .historyfix
|
||||
|
||||
%build
|
||||
export CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $RPM_OPT_FLAGS"
|
||||
export CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $RPM_OPT_FLAGS -Wno-strict-aliasing"
|
||||
%configure --with-screen=slang \
|
||||
--enable-charset \
|
||||
--with-samba \
|
||||
@ -97,6 +87,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%dir %{_libexecdir}/mc/extfs.d
|
||||
|
||||
%changelog
|
||||
* Tue Sep 7 2010 Jindrich Novy <jnovy@redhat.com> 4.7.4-1
|
||||
- update to 4.7.4 (#630900)
|
||||
|
||||
* Fri Sep 3 2010 Jindrich Novy <jnovy@redhat.com> 4.7.3-4
|
||||
- fix segfault when pressing Cancel in Replace String dialog (#629847)
|
||||
- show proper contents in history and fix memleak (ticket #2299)
|
||||
|
Loading…
Reference in New Issue
Block a user