Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 17771 Details for
Bug 28800
mc's (4.6.0) case insensitivity option in the find dialog doesn't work
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
A patch that fixes this bug
mc-4.6.0-find-case_sensitivity.patch (text/plain), 5.66 KB, created by
Michal Januszewski (RETIRED)
on 2003-09-15 09:17:17 UTC
(
hide
)
Description:
A patch that fixes this bug
Filename:
MIME Type:
Creator:
Michal Januszewski (RETIRED)
Created:
2003-09-15 09:17:17 UTC
Size:
5.66 KB
patch
obsolete
>diff -Naur mc-4.6.0-orig/src/cmd.c mc-4.6.0/src/cmd.c >--- mc-4.6.0-orig/src/cmd.c 2003-02-05 16:54:33.000000000 +0100 >+++ mc-4.6.0/src/cmd.c 2003-09-15 17:24:51.000000000 +0200 >@@ -542,7 +542,7 @@ > if (dirflag) > continue; > } >- c = regexp_match (reg_exp_t, cpanel->dir.list [i].fname, match_file); >+ c = regexp_match (reg_exp_t, cpanel->dir.list [i].fname, match_file, 0); > if (c == -1){ > message (1, MSG_ERROR, _(" Malformed regular expression ")); > g_free (reg_exp); >@@ -588,7 +588,7 @@ > if (dirflag) > continue; > } >- c = regexp_match (reg_exp_t, cpanel->dir.list [i].fname, match_file); >+ c = regexp_match (reg_exp_t, cpanel->dir.list [i].fname, match_file, 0); > if (c == -1){ > message (1, MSG_ERROR, _(" Malformed regular expression ")); > g_free (reg_exp); >diff -Naur mc-4.6.0-orig/src/dir.c mc-4.6.0/src/dir.c >--- mc-4.6.0-orig/src/dir.c 2003-01-21 01:41:45.000000000 +0100 >+++ mc-4.6.0/src/dir.c 2003-09-15 17:25:06.000000000 +0200 >@@ -404,7 +404,7 @@ > *stale_link = 1; > } > if (!(S_ISDIR (buf1->st_mode) || *link_to_dir) && filter >- && !regexp_match (filter, dp->d_name, match_file)) >+ && !regexp_match (filter, dp->d_name, match_file, 0)) > return 0; > > /* Need to grow the *list? */ >diff -Naur mc-4.6.0-orig/src/ext.c mc-4.6.0/src/ext.c >--- mc-4.6.0-orig/src/ext.c 2002-11-14 08:25:19.000000000 +0100 >+++ mc-4.6.0/src/ext.c 2003-09-15 17:25:32.000000000 +0200 >@@ -450,7 +450,7 @@ > > if (content_string && content_string[0] > && regexp_match (ptr, content_string + content_shift, >- match_normal)) { >+ match_normal, 0)) { > found = 1; > } > >@@ -593,11 +593,11 @@ > /* Do not transform shell patterns, you can use shell/ for > * that > */ >- if (regexp_match (p, filename, match_normal)) >+ if (regexp_match (p, filename, match_normal, 0)) > found = 1; > } else if (!strncmp (p, "directory/", 10)) { > if (S_ISDIR (mystat.st_mode) >- && regexp_match (p + 10, filename, match_normal)) >+ && regexp_match (p + 10, filename, match_normal, 0)) > found = 1; > } else if (!strncmp (p, "shell/", 6)) { > p += 6; >diff -Naur mc-4.6.0-orig/src/find.c mc-4.6.0/src/find.c >--- mc-4.6.0-orig/src/find.c 2002-12-24 12:28:26.000000000 +0100 >+++ mc-4.6.0/src/find.c 2003-09-15 17:55:21.000000000 +0200 >@@ -507,6 +507,7 @@ > static int pos; > static int subdirs_left = 0; > char *tmp_name; /* For building file names */ >+ int flags = 0; > > if (!h) { /* someone forces me to close dirp */ > if (dirp) { >@@ -516,6 +517,10 @@ > dp = 0; > return 1; > } >+ >+ if (!(case_sense->state & C_BOOL)) >+ flags |= REG_ICASE; >+ > do_search_begin: > while (!dp){ > >@@ -589,7 +594,7 @@ > } > } > >- if (regexp_match (find_pattern, dp->d_name, match_file)){ >+ if (regexp_match (find_pattern, dp->d_name, match_file, flags)){ > if (content_pattern) > search_content (h, directory, dp->d_name); > else >diff -Naur mc-4.6.0-orig/src/user.c mc-4.6.0/src/user.c >--- mc-4.6.0-orig/src/user.c 2002-11-29 04:03:53.000000000 +0100 >+++ mc-4.6.0/src/user.c 2003-09-15 17:26:18.000000000 +0200 >@@ -390,18 +390,18 @@ > break; > case 'f': /* file name pattern */ > p = extract_arg (p, arg); >- *condition = panel && regexp_match (arg, panel->dir.list [panel->selected].fname, match_file); >+ *condition = panel && regexp_match (arg, panel->dir.list [panel->selected].fname, match_file, 0); > break; > case 'y': /* syntax pattern */ > if (edit_widget && edit_widget->syntax_type) { > p = extract_arg (p, arg); > *condition = panel && >- regexp_match (arg, edit_widget->syntax_type, match_normal); >+ regexp_match (arg, edit_widget->syntax_type, match_normal, 0); > } > break; > case 'd': > p = extract_arg (p, arg); >- *condition = panel && regexp_match (arg, panel->cwd, match_file); >+ *condition = panel && regexp_match (arg, panel->cwd, match_file, 0); > break; > case 't': > p = extract_arg (p, arg); >diff -Naur mc-4.6.0-orig/src/util.c mc-4.6.0/src/util.c >--- mc-4.6.0-orig/src/util.c 2003-01-28 23:58:23.000000000 +0100 >+++ mc-4.6.0/src/util.c 2003-09-15 17:55:00.000000000 +0200 >@@ -537,26 +537,29 @@ > return g_strdup (pattern); > } > >-int regexp_match (char *pattern, char *string, int match_type) >+int regexp_match (char *pattern, char *string, int match_type, int flags) > { > static regex_t r; > static char *old_pattern = NULL; > static int old_type; >+ static int old_flags; > int rval; > >- if (!old_pattern || STRCOMP (old_pattern, pattern) || old_type != match_type){ >+ if (!old_pattern || STRCOMP (old_pattern, pattern) || old_type != match_type || old_flags != flags){ > if (old_pattern){ > regfree (&r); > g_free (old_pattern); > old_pattern = NULL; > } > pattern = convert_pattern (pattern, match_type, 0); >- if (regcomp (&r, pattern, REG_EXTENDED|REG_NOSUB|MC_ARCH_FLAGS)) { >+ >+ if (regcomp (&r, pattern, REG_EXTENDED|REG_NOSUB|MC_ARCH_FLAGS|flags)) { > g_free (pattern); > return -1; > } > old_pattern = pattern; > old_type = match_type; >+ old_flags = flags; > } > rval = !regexec (&r, string, 0, NULL, 0); > return rval; >diff -Naur mc-4.6.0-orig/src/util.h mc-4.6.0/src/util.h >--- mc-4.6.0-orig/src/util.h 2003-01-27 22:07:29.000000000 +0100 >+++ mc-4.6.0/src/util.h 2003-09-15 17:23:04.000000000 +0200 >@@ -65,7 +65,7 @@ > enum { match_file, match_normal }; > extern int easy_patterns; > char *convert_pattern (char *pattern, int match_type, int do_group); >-int regexp_match (char *pattern, char *string, int match_type); >+int regexp_match (char *pattern, char *string, int match_type, int flags); > > /* Error pipes */ > void open_error_pipe (void);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 28800
: 17771