Am Freitag, 2. Juni 2006 14:20 schrieb Pavel Tsekov:
> On Thu, 1 Jun 2006, Nabil Sayegh wrote:
> It is not immediatly obvious that all three patches should be applied
> to get the final version. Please, resubmit a real final patch.
done
I seem to be slightly unconcentrated the last days :-/
> do_load_string is not defined if USE_NETCODE is not set.
fixed
rgds
--
Nabil Sayegh
diff -uriwbB mc-4.6.1/doc/mc.1.in mc-4.6.1-find_ignore_dirs_regex-4/doc/mc.1.in
--- mc-4.6.1/doc/mc.1.in 2005-06-08 14:27:06.000000000 +0200
+++ mc-4.6.1-find_ignore_dirs_regex-4/doc/mc.1.in 2006-06-02 20:01:54.000000000 +0200
@@ -1218,12 +1218,12 @@
.B Misc
section of your ~/.mc/ini file.
.PP
-Directory components should be separated with a colon, here is an
+The variable holds a regular expression, here is an
example:
.PP
.nf
[Misc]
-find_ignore_dirs=/cdrom:/nfs/wuarchive:/afs
+find_ignore_dirs=^\.?/(cdrom|nfs/wuarchive|afs)/
.fi
.PP
You may consider using the
diff -uriwbB mc-4.6.1/src/find.c mc-4.6.1-find_ignore_dirs_regex-4/src/find.c
--- mc-4.6.1/src/find.c 2005-05-27 16:19:18.000000000 +0200
+++ mc-4.6.1-find_ignore_dirs_regex-4/src/find.c 2006-06-02 20:01:54.000000000 +0200
@@ -69,7 +69,7 @@
} FindProgressStatus;
/* List of directories to be ignored, separated by ':' */
-char *find_ignore_dirs = 0;
+char *find_ignore_dirs = NULL;
static WInput *in_start; /* Start path */
static WInput *in_name; /* Pattern to search */
@@ -606,12 +606,9 @@
stop_idle (h);
return 0;
}
- if (find_ignore_dirs){
+ if (find_ignore_dirs && find_ignore_dirs[0] != '\0'){
int found;
- char *temp_dir = g_strconcat (":", tmp, ":", (char *) NULL);
-
- found = strstr (find_ignore_dirs, temp_dir) != 0;
- g_free (temp_dir);
+ found = regexp_match (find_ignore_dirs, tmp, match_regex);
if (found)
g_free (tmp);
else
diff -uriwbB mc-4.6.1/src/find.h mc-4.6.1-find_ignore_dirs_regex-4/src/find.h
--- mc-4.6.1/src/find.h 1998-12-02 22:27:39.000000000 +0100
+++ mc-4.6.1-find_ignore_dirs_regex-4/src/find.h 2006-06-02 20:01:54.000000000 +0200
@@ -1,6 +1,7 @@
#ifndef __FIND_H
#define __FIND_H
+extern char *find_ignore_dirs;
void do_find (void);
#endif
diff -uriwbB mc-4.6.1/src/setup.c mc-4.6.1-find_ignore_dirs_regex-4/src/setup.c
--- mc-4.6.1/src/setup.c 2005-05-27 16:19:18.000000000 +0200
+++ mc-4.6.1-find_ignore_dirs_regex-4/src/setup.c 2006-06-02 20:10:56.000000000 +0200
@@ -40,6 +40,7 @@
#include "win.h" /* lookup_key */
#include "cmd.h"
#include "file.h" /* safe_delete */
+#include "find.h"
#ifdef USE_VFS
#include "../vfs/gc.h"
@@ -58,8 +59,6 @@
#endif
-extern char *find_ignore_dirs;
-
extern int num_history_items_recorded;
char *profile_name; /* .mc/ini */
@@ -434,20 +433,18 @@
return mode;
}
-#ifdef USE_NETCODE
static char *
-do_load_string (const char *s, const char *ss, const char *def)
+do_load_string (const char *s, const char *ss, const char *def, size_t size)
{
- char *buffer = g_malloc (BUF_SMALL);
+ char *buffer = g_malloc (size);
char *p;
- load_string (s, ss, def, buffer, BUF_SMALL);
+ load_string (s, ss, def, buffer, size);
p = g_strdup (buffer);
g_free (buffer);
return p;
}
-#endif /* !USE_NETCODE */
char *
setup_init (void)
@@ -517,13 +514,10 @@
GetPrivateProfileInt ("Dirs", "current_is_left", 1, profile);
#ifdef USE_NETCODE
- ftpfs_proxy_host = do_load_string ("Misc", "ftp_proxy_host", "gate");
+ ftpfs_proxy_host = do_load_string ("Misc", "ftp_proxy_host", "gate", BUF_SMALL);
#endif
- load_string ("Misc", "find_ignore_dirs", "", setup_color_string,
- sizeof (setup_color_string));
- if (setup_color_string [0])
- find_ignore_dirs = g_strconcat (":", setup_color_string, ":", (char *) NULL);
+ find_ignore_dirs = do_load_string ("Misc", "find_ignore_dirs", "", BUF_MEDIUM);
/* The default color and the terminal dependent color */
load_string ("Colors", "base_color", "", setup_color_string,
_______________________________________________
Mc mailing list
http://mail.gnome.org/mailman/listinfo/mc