From a8aa5cf678d9413999ac2765be9a90e8f3f7ea3d Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Thu, 7 Oct 2010 11:29:36 +0300 Subject: [PATCH] Added definition MC_MAXFILENAMELEN for specify maximum file lenght. Signed-off-by: Slava Zanko --- lib/fs.h | 6 ++++++ src/panel.h | 4 ++-- src/tree.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/fs.h b/lib/fs.h index 9fa0c0197..edb7e09e1 100644 --- a/lib/fs.h +++ b/lib/fs.h @@ -56,6 +56,12 @@ #define NLENGTH(dirent) (strlen ((dirent)->d_name)) #define DIRENT_LENGTH_COMPUTED 1 +#ifndef MAXNAMLEN +# define MC_MAXFILENAMELEN 256 +#else +# define MC_MAXFILENAMELEN MAXNAMLEN +#endif + static inline void compute_namelen (struct dirent *dent __attribute__ ((unused))) { diff --git a/src/panel.h b/src/panel.h index 53d89696c..db9dc712b 100644 --- a/src/panel.h +++ b/src/panel.h @@ -98,8 +98,8 @@ typedef struct WPanel { int codepage; /* panel codepage */ gboolean searching; - char search_buffer [256]; - char prev_search_buffer [256]; + char search_buffer [MC_MAXFILENAMELEN]; + char prev_search_buffer [MC_MAXFILENAMELEN]; char search_char [MB_LEN_MAX]; /*buffer for multibytes characters*/ int search_chpoint; /*point after last characters in search_char*/ } WPanel; diff --git a/src/tree.c b/src/tree.c index 6017b837e..9aed068c7 100644 --- a/src/tree.c +++ b/src/tree.c @@ -82,7 +82,7 @@ struct WTree Widget widget; struct TreeStore *store; tree_entry *selected_ptr; /* The selected directory */ - char search_buffer[256]; /* Current search string */ + char search_buffer[MC_MAXFILENAMELEN]; /* Current search string */ tree_entry **tree_shown; /* Entries currently on screen */ int is_panel; /* panel or plain widget flag */ int active; /* if it's currently selected */