From kai at cmail.ru Fri Nov 2 15:31:47 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Fri, 2 Nov 2001 17:31:47 +0200 Subject: MAD changes Message-ID: <20011102173147.A28353@bcs.zp.ua> Hi, all! I suggest this patch to incorporate into cvs. Glib support enabled again now - sorry Pavel, but without it builtin editor fails on each search. I write mad_get_current_dir to use instead of g_get_current_dir. Also mad_tempname now has file and line parameters. Fill free to fix my ChangeLog. I will be offline until Monday. Regards, Andrew. ChangeLog: * mad.h: Enable glib support - builtin editor fails without it. * mad.[ch] (mad_get_current_dir): New function to use instead of g_get_current_dir. (mad_tempnam): Add file and line parameters. (mad_alloc0): Make file parameter const. (mad_realloc): Likewise. (mad_strdup): Likewise. (mad_strndup): Likewise. (mad_free): Likewise. (mad_finalize): Likewise. Index: mad.h =================================================================== RCS file: /cvs/gnome/mc/src/mad.h,v retrieving revision 1.14 diff -u -p -r1.14 mad.h --- mad.h 2001/08/11 05:13:10 1.14 +++ mad.h 2001/11/02 14:47:32 @@ -30,7 +30,7 @@ # undef calloc #endif -#define tempnam(x,y) mad_tempnam (x, y) +#define tempnam(x,y) mad_tempnam (x, y, __FILE__, __LINE__) #define malloc(x) mad_alloc (x, __FILE__, __LINE__) #define calloc(x, y) mad_alloc0 ((x) * (y), __FILE__, __LINE__) @@ -50,7 +50,7 @@ * Define MAD_GLIB to debug allocations in glib as well. * This code is not functional yet. */ -#undef MAD_GLIB +#define MAD_GLIB #ifdef MAD_GLIB /* These definitions are grabbed from GLib.h */ @@ -70,22 +70,24 @@ #define g_strconcat mad_strconcat #define g_strdup_printf mad_strdup_printf #define g_strdup_vprintf mad_strdup_vprintf +#define g_get_current_dir() mad_get_current_dir (__FILE__, __LINE__) #endif /* MAD_GLIB */ void mad_init (void); void mad_set_debug (const char *file); void mad_check (const char *file, int line); void *mad_alloc (int size, const char *file, int line); -void *mad_alloc0 (int size, char *file, int line); -void *mad_realloc (void *ptr, int newsize, char *file, int line); -char *mad_strdup (const char *s, char *file, int line); -char *mad_strndup (const char *s, int n, char *file, int line); -void mad_free (void *ptr, char *file, int line); -void mad_finalize (char *file, int line); -char *mad_tempnam (char *s1, char *s2); +void *mad_alloc0 (int size, const char *file, int line); +void *mad_realloc (void *ptr, int newsize, const char *file, int line); +char *mad_strdup (const char *s, const char *file, int line); +char *mad_strndup (const char *s, int n, const char *file, int line); +void mad_free (void *ptr, const char *file, int line); +void mad_finalize (const char *file, int line); +char *mad_tempnam (char *s1, char *s2, const char *file, int line); char *mad_strconcat (const char *first, ...); char *mad_strdup_printf (const char *format, ...); char *mad_strdup_vprintf (const char *format, va_list args); +char *mad_get_current_dir (const char *file, int line); #else Index: mad.c =================================================================== RCS file: /cvs/gnome/mc/src/mad.c,v retrieving revision 1.12 diff -u -p -r1.12 mad.c --- mad.c 2001/08/06 15:32:34 1.12 +++ mad.c 2001/11/02 14:47:32 @@ -36,6 +36,7 @@ #undef g_strdup #undef g_strndup #undef g_free +#undef g_get_current_dir #include #include @@ -180,7 +181,7 @@ void *mad_alloc (int size, const char *f } /* Reallocates a memory area. Used instead of realloc. */ -void *mad_realloc (void *ptr, int newsize, char *file, int line) +void *mad_realloc (void *ptr, int newsize, const char *file, int line) { int i; char *area; @@ -211,16 +212,15 @@ void *mad_realloc (void *ptr, int newsiz *(mem_areas [i].start_sig) = MAD_SIGNATURE; *(mem_areas [i].end_sig) = MAD_SIGNATURE; - if (strlen (file) >= MAD_MAX_FILE) - file [MAD_MAX_FILE - 1] = 0; - strcpy (mem_areas [i].file, file); + strncpy (mem_areas [i].file, file, MAD_MAX_FILE - 1); + mem_areas [i].file [MAD_MAX_FILE - 1] = 0; mem_areas [i].line = line; return mem_areas [i].data; } /* Allocates a memory area. Used instead of malloc and calloc. */ -void *mad_alloc0 (int size, char *file, int line) +void *mad_alloc0 (int size, const char *file, int line) { char *t; @@ -230,7 +230,7 @@ void *mad_alloc0 (int size, char *file, } /* Duplicates a character string. Used instead of strdup. */ -char *mad_strdup (const char *s, char *file, int line) +char *mad_strdup (const char *s, const char *file, int line) { if (s) { char *t; @@ -244,7 +244,7 @@ char *mad_strdup (const char *s, char *f /* Duplicates a character string. Used instead of strndup. */ /* Dup of GLib's gstrfuncs.c:g_strndup() */ -char *mad_strndup (const char *s, int n, char *file, int line) +char *mad_strndup (const char *s, int n, const char *file, int line) { if(s) { char *new_str = mad_alloc(n + 1, file, line); @@ -257,7 +257,7 @@ char *mad_strndup (const char *s, int n, } /* Frees a memory area. Used instead of free. */ -void mad_free (void *ptr, char *file, int line) +void mad_free (void *ptr, const char *file, int line) { int i; @@ -300,18 +300,18 @@ void mad_free (void *ptr, char *file, in Alloc_idx_hint = i; } -char *mad_tempnam (char *a, char *b) +char *mad_tempnam (char *a, char *b, const char *file, int line) { char *t, *u; t = tempnam(a,b); /* This malloc's internal buffer.. */ - u = mad_strdup(t, "(mad_tempnam)", 0); + u = mad_strdup(t, file, line); free(t); return u; } /* Outputs a list of unfreed memory areas, to be called as a last thing before exiting */ -void mad_finalize (char *file, int line) +void mad_finalize (const char *file, int line) { int i; @@ -398,5 +398,14 @@ mad_strdup_printf (const char *format, . va_end (args); return buffer; +} + +char* +mad_get_current_dir (const char *file, int line) +{ + char *cwd = g_get_current_dir (); + char *ret = mad_strdup (cwd, file, line); + g_free (cwd); + return ret; } #endif /* HAVE_MAD */ From proski at gnu.org Fri Nov 2 20:05:34 2001 From: proski at gnu.org (Pavel Roskin) Date: Fri, 2 Nov 2001 15:05:34 -0500 Subject: MAD changes In-Reply-To: <20011102173147.A28353@bcs.zp.ua>; from kai@cmail.ru on Fri, Nov 02, 2001 at 05:31:47PM +0200 References: <20011102173147.A28353@bcs.zp.ua> Message-ID: <20011102150534.A26602@gnu.org> Hello, Andrew! > I suggest this patch to incorporate into cvs. Glib support enabled > again now - sorry Pavel, but without it builtin editor fails on each > search. I write mad_get_current_dir to use instead of g_get_current_dir. > Also mad_tempname now has file and line parameters. No need to say sorry. I disabled Glib support before 4.5.55 because MAD didn't take care of some functions in Glib allocating memory (which was especially bad for gmc). If you can reimplement them all (fortunately we don't care about gmc now), then it's fine to reenable Glib support. Better yet, we could make Glib use malloc from MAD (sorry, I cannot check right now whether it's possible). Last time I checked, the editor was failing for a real reason - it used Glib malloc() to allocate the memory and standard (i.e. libc) free() or vice versa. This is a real problem, and it should be fixed. Glib is not guaranteed to use the same memory pool as Libc. In fact, I remember seeing comments saying that it's the real issue on *BSD. Of course, having Glib support is better than not having it, so please go ahead with your patch, but please realize that the problem in the editor is real. The ChangeLog should be changed accordingly. In order to simulate the worst case scenario, MAD should use two separate pools for malloc() and g_malloc(). But it can be done later. I'm still in process of moving home, but I hope to return to the normal "work mode" by the end of the next week. I'm sorry for increased "latency" and lower "quality" of my replies in the meantime. -- Regards, Pavel Roskin From avarakin00 at hotmail.com Mon Nov 5 05:19:38 2001 From: avarakin00 at hotmail.com (Alexander Varakin) Date: Mon, 5 Nov 2001 00:19:38 -0500 Subject: "Save file position" in mc editor Message-ID: It would be very nice to add a new feature to mc editor, so it will remember file positions in each previously opened file, and return to that position when the file will be opened next time. This is very common feature of all editors, ide's and even FAR has it. Are there any plans to do that? Regards, Alex From kai at cmail.ru Mon Nov 5 08:54:47 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Mon, 05 Nov 2001 10:54:47 +0200 Subject: MAD changes References: <20011102173147.A28353@bcs.zp.ua> <20011102150534.A26602@gnu.org> Message-ID: <3BE653D7.DD0DBD84@cmail.ru> Pavel Roskin wrote: > Hello, Andrew! > > > I suggest this patch to incorporate into cvs. Glib support enabled > > again now - sorry Pavel, but without it builtin editor fails on each > > search. I write mad_get_current_dir to use instead of g_get_current_dir. > > Also mad_tempname now has file and line parameters. > > No need to say sorry. I disabled Glib support before 4.5.55 because MAD > didn't take care of some functions in Glib allocating memory (which was > especially bad for gmc). If you can reimplement them all (fortunately > we don't care about gmc now), then it's fine to reenable Glib support. > Sometimes I think about something like naturalize_glib_memory_area() for g_strdup_printf, g_get_current_dir and so on. > > Better yet, we could make Glib use malloc from MAD (sorry, I cannot > check right now whether it's possible). > > Last time I checked, the editor was failing for a real reason - it used > Glib malloc() to allocate the memory and standard (i.e. libc) free() or > vice versa. This is a real problem, and it should be fixed. Glib is > not guaranteed to use the same memory pool as Libc. In fact, I remember > seeing comments saying that it's the real issue on *BSD. > > Of course, having Glib support is better than not having it, so please > go ahead with your patch, but please realize that the problem in the > editor is real. The ChangeLog should be changed accordingly. > I found some these places. Patch will be commited soon. > > In order to simulate the worst case scenario, MAD should use two separate > pools for malloc() and g_malloc(). But it can be done later. > Why we can't add #define free g_free #define strdup g_strdup . . . and so on in edit.h? It is easiest way. Regards, Andrew. From kai at cmail.ru Thu Nov 8 09:03:00 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Thu, 8 Nov 2001 11:03:00 +0200 Subject: Filtered view (M!) works again Message-ID: <20011108110300.A371@bcs.zp.ua> Hi, Pavel! This patch makes "Filtered view" (M-!) feature work again and fixes memory leak. It was broken recently with file type checks. P.S. Some days ago I mailed --enable-largefile vs smbfs is fixed. It is not so. sizeof (off_t) == 8 in MC but 4 in samba. ChangeLog: * view.c (do_view_init): Make sure _file is not an empty string before mc_stat and mc_open. Memory leak fixed. --- view.c-orig Thu Nov 8 09:36:43 2001 +++ view.c Thu Nov 8 10:23:01 2001 @@ -539,34 +539,34 @@ do_view_init (WView *view, char *_comman view->start_col = 0; } - /* Make sure we are working with a regular file */ - if (mc_stat (view->filename, &view->s) == -1) { - g_snprintf (tmp, sizeof (tmp), _(" Cannot stat \"%s\"\n %s "), - _file, unix_error_string (errno)); - error = set_view_init_error (view, tmp); - goto finish; - } + if (_file[0]) { + /* Make sure we are working with a regular file */ + if (mc_stat (view->filename, &view->s) == -1) { + g_snprintf (tmp, sizeof (tmp), _(" Cannot stat \"%s\"\n %s "), + _file, unix_error_string (errno)); + error = set_view_init_error (view, tmp); + goto finish; + } - if (!S_ISREG (view->s.st_mode)) { - g_snprintf (tmp, sizeof (tmp), - _(" Cannot view: not a regular file ")); - error = set_view_init_error (view, tmp); - goto finish; - } + if (!S_ISREG (view->s.st_mode)) { + g_snprintf (tmp, sizeof (tmp), + _(" Cannot view: not a regular file ")); + error = set_view_init_error (view, tmp); + goto finish; + } - /* Actually open the file */ - if ((fd = mc_open(_file, O_RDONLY)) == -1) { - g_snprintf (tmp, sizeof (tmp), _(" Cannot open \"%s\"\n %s "), - _file, unix_error_string (errno)); - error = set_view_init_error (view, tmp); - goto finish; - } + /* Actually open the file */ + if ((fd = mc_open(_file, O_RDONLY)) == -1) { + g_snprintf (tmp, sizeof (tmp), _(" Cannot open \"%s\"\n %s "), + _file, unix_error_string (errno)); + error = set_view_init_error (view, tmp); + goto finish; + } - if (_file[0] && view->viewer_magic_flag && (is_gunzipable (fd, &type)) != 0) { - g_free (view->filename); - view->filename = g_strconcat (_file, decompress_extension(type), NULL); - } else { - view->filename = g_strdup (_file); + if (view->viewer_magic_flag && (is_gunzipable (fd, &type)) != 0) { + g_free (view->filename); + view->filename = g_strconcat (_file, decompress_extension(type), NULL); + } } if (_command && (view->viewer_magic_flag || _file[0] == '\0')) From kai at cmail.ru Thu Nov 8 14:02:06 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Thu, 8 Nov 2001 16:02:06 +0200 Subject: question to maintainers In-Reply-To: <000701c1579d$74606180$0300000a@srvmain> References: <000701c1579d$74606180$0300000a@srvmain> Message-ID: <20011108160206.A26544@bcs.zp.ua> Hi, Walery! > > I'm asking maintainers about my patch, > that adds support for multiple editors and multiple viewers at once, > that has been posted a MONTHS ago. > This patch was extensively tested by me and I use its benefits every day. > Also that was reports that it works very well for other people. > This patch almost does not affect stability of MC if its features > are not used by users. > > I'm wondered why there is no single report > about this patch from maintainers at all. Still. > Even no report that they have seen it. > I can imagine two possible reasons for that: > > 1) They have no time at all to apply and test this. It is true. And another reason is a lot of pending stability issues in current mc. Also there are many documented but not or poorly implemented features. Smbfs is only one of these features. Cpiofs does not understand old ascii cpio archives. Uploaded files data is copied to temporary files and only after this is transfered to destionation. Ftpfs is not nice. Editor cannot find and replace regexps. > In this case I can supply some screenshots ;) > > 2) They think that this feature is not useful and even harmful. It seems to be interesting feature, but there is a lot of ways to crush mc now. And it will be pity to crush after many hours of editing. > Well, in this case they have to argue their POVs. > (Also MC are used by too many people, so > its future cannot be controlled by its maintainers exclusively, > according to only their POVs.) What is POV? Well, I spent some hours to apply your patch to cvs version of mc. Where are some number of rejected hunks, but as a rule it is possible rewrite this patch to be compatible with mc-4.5.55 and CVS. It is not good idea change lines near $Id tag. And why do you export run_dlg and finish view anyway? Ok, I have a patch for your patch. I don't know what compiler do you use, but egcs-1.1.2 can't use union without name ;-( Also g_snprintf is used instead of sprintf. In two files excluded - it already included from other places. Regards, Andrew. --- mc-multiscreen+b+c-patch-0.5-orig Sat Sep 8 07:03:34 2001 +++ mc-multiscreen+b+c-patch-0.5 Thu Nov 8 15:17:54 2001 @@ -137,17 +135,9 @@ /* Process a block through a shell command: CK_Pipe_Block(i) executes shell_cmd[i]. diff -ruNbB -x ChangeLog -x Makefile -x *CVS* -x .* -x *.hlp mc-4.5.55-orig/gtkedit/editmenu.c mc-4.5.55/gtkedit/editmenu.c --- mc-4.5.55-orig/gtkedit/editmenu.c Sun Aug 12 14:02:56 2001 +++ mc-4.5.55/gtkedit/editmenu.c Fri Sep 7 23:41:56 2001 -@@ -34,6 +34,7 @@ - - #ifdef MIDNIGHT - -+#include - #include "../src/mad.h" - - extern int edit_key_emulation; @@ -122,6 +123,15 @@ void menu_user_menu_cmd (void) { menu_key (KEY_F (11)); } @@ -490,17 +481,6 @@ diff -ruNbB -x ChangeLog -x Makefile -x *CVS* -x .* -x *.hlp mc-4.5.55-orig/src/dialog.c mc-4.5.55/src/dialog.c --- mc-4.5.55-orig/src/dialog.c Tue Aug 22 18:50:14 2000 +++ mc-4.5.55/src/dialog.c Fri Sep 7 23:08:11 2001 -@@ -32,6 +32,10 @@ - #include "dlg.h" /* draw_box, yes I know, it's silly */ - #include "fileopctx.h" - -+#ifdef MC_DEBUG -+#include -+#endif -+ - /* "$Id: dialog.c,v 1.8 2000/08/22 22:50:14 proskin Exp $" */ - - Refresh *refresh_list = 0; @@ -46,6 +50,9 @@ new->parameter = parameter; new->flags = flags; @@ -588,7 +568,7 @@ + WButtonBar *edit_bar; + WMenu *edit_menubar; + } editor_data; -+ }; ++ } u; +} MC_Dialog; + +/* List of (background) dialogs: filemanagers, editors, viewers */ @@ -670,8 +650,8 @@ + return g_strdup_printf( _("View: %s"), mcdlg->filename ); + case DLG_EDITOR: { + int modified = -+ mcdlg->editor_data.wedit -+ ? mcdlg->editor_data.wedit->modified ++ mcdlg->u.editor_data.wedit ++ ? mcdlg->u.editor_data.wedit->modified + : 0; + return g_strdup_printf( + _("Edit: %s%s"), @@ -735,8 +715,8 @@ + int *move_dir_p, WView *wview ) +{ + dlglist_add_dialog( dlg, DLG_VIEWER, filename ); -+ current_mcdlg->viewer_data.move_dir_p = move_dir_p; -+ current_mcdlg->viewer_data.wview = wview; ++ current_mcdlg->u.viewer_data.move_dir_p = move_dir_p; ++ current_mcdlg->u.viewer_data.wview = wview; +} + +void dlglist_add_editor( @@ -744,9 +724,9 @@ + WEdit *wedit, WButtonBar *edit_bar, WMenu *edit_menubar ) +{ + dlglist_add_dialog( edit_dlg, DLG_EDITOR, filename ); -+ current_mcdlg->editor_data.wedit = wedit; -+ current_mcdlg->editor_data.edit_bar = edit_bar; -+ current_mcdlg->editor_data.edit_menubar = edit_menubar; ++ current_mcdlg->u.editor_data.wedit = wedit; ++ current_mcdlg->u.editor_data.edit_bar = edit_bar; ++ current_mcdlg->u.editor_data.edit_menubar = edit_menubar; +} + +void dlglist_dialog_switch( Direction direction, int dlgnum ) @@ -816,15 +796,15 @@ + if (current_mcdlg->dlg_type == DLG_VIEWER) + { + run_view( current_mcdlg->dlg, -+ current_mcdlg->viewer_data.move_dir_p, -+ current_mcdlg->viewer_data.wview ); ++ current_mcdlg->u.viewer_data.move_dir_p, ++ current_mcdlg->u.viewer_data.wview ); + } + else if (current_mcdlg->dlg_type == DLG_EDITOR) + { + run_edit( current_mcdlg->dlg, -+ current_mcdlg->editor_data.wedit, -+ current_mcdlg->editor_data.edit_bar, -+ current_mcdlg->editor_data.edit_menubar ); ++ current_mcdlg->u.editor_data.wedit, ++ current_mcdlg->u.editor_data.edit_bar, ++ current_mcdlg->u.editor_data.edit_menubar ); + } else { + g_error( "dlglist_process_pending_dialog: " + "DLG_MANAGER can't be 'pending' dialog!" ); @@ -909,7 +889,7 @@ + char *dlgtitle, buffer[255]; + MC_Dialog *cur_mcdlg = (MC_Dialog*) cur_node->data; + dlgtitle = dlglist_get_dialog_title( cur_mcdlg ); -+ sprintf( buffer, "%c %s", get_hot_key(i), dlgtitle ); ++ g_snprintf( buffer, sizeof (buffer), "%c %s", get_hot_key(i), dlgtitle ); + g_free( dlgtitle ); + + LISTBOX_APPEND_TEXT( listbox, get_hot_key(i), buffer, NULL ); @@ -1017,14 +997,14 @@ +#endif + + finish_view( current_mcdlg->dlg, -+ current_mcdlg->viewer_data.move_dir_p, -+ current_mcdlg->viewer_data.wview ); ++ current_mcdlg->u.viewer_data.move_dir_p, ++ current_mcdlg->u.viewer_data.wview ); + + } else if (cur_mcdlg->dlg_type == DLG_EDITOR) { + + current_mcdlg = cur_mcdlg; + -+ if (! current_mcdlg->editor_data.wedit->modified) { ++ if (! current_mcdlg->u.editor_data.wedit->modified) { + /* Kill unmodified editors */ +#ifdef MC_DEBUG + { @@ -1036,9 +1016,9 @@ +#endif + finish_edit( + current_mcdlg->dlg, -+ current_mcdlg->editor_data.wedit, -+ current_mcdlg->editor_data.edit_bar, -+ current_mcdlg->editor_data.edit_menubar ); ++ current_mcdlg->u.editor_data.wedit, ++ current_mcdlg->u.editor_data.edit_bar, ++ current_mcdlg->u.editor_data.edit_menubar ); + } else { + /* Activate modified editor, so user can save file */ +#ifdef MC_DEBUG From av1474 at comtv.ru Fri Nov 9 00:20:17 2001 From: av1474 at comtv.ru (Vassili Karpov) Date: Fri, 9 Nov 2001 03:20:17 +0300 Subject: your mail In-Reply-To: References: <20011109020900.34e90359.av1474@comtv.ru> Message-ID: <20011109032017.09e40293.av1474@comtv.ru> On Thu, 8 Nov 2001 06:26:48 -0500 (EST) Pavel Roskin wrote: > Hello, Vassili! > > > > Could you please remind me what you patch was and what software it was > > > for? If there is a mailing list for that project, please copy to the > > > mailing list - you mail will be archived and maybe somebody else will > > > answer you. > > Patch for MC - aligned extensions. Im not very keen to the idea of subscribing to > > yet another mailing list (too many already). > > I remember answering that e-mail, but I cannot find either your original > mail or my reply in the mailing list archives. > > My answer was that aligning the extensions is wrong because this would > make the filenames ambigous. UNIX allows spaces in the filenames, so > "filename ext" may be a valid name. Nobody forces you to use it, thats why config.c (if my memory serves me) was modifed to look for align_extensions=1 in ini. Id argue that the visual feedback aligned extensions provides far outweights 2 problem it introduces: first being the one you presented and second multiple dot's in filename. The idea is not mine, i stole it from win32 file manager FAR(http://www.rarsoft.com/far_manager.htm) all win32 filesystem can have spaces in filenames aswel, that didnt stop FAR author from introducing this behavior (again in FAR its optional aswel). I urge MC developers/users to try it, its good... really.. >B) -- mailto:malc at pulsesoft.com From proski at gnu.org Mon Nov 12 22:35:41 2001 From: proski at gnu.org (Pavel Roskin) Date: Mon, 12 Nov 2001 17:35:41 -0500 (EST) Subject: Option "-X" removed Message-ID: Hello! I've removed the "-X" option that was supposed to stop the subshell process until the debugger is attached. The option was not actually implemented, and I decided not to implement it, but rather remove the option. I believe that everybody capable of debugging the subshell should be able to add this code when needed. There was no need to expose this option to the users, especially translate it. The last thing we need is to see reports that "mc -X" doesn't work or that "mc -X" hangs. In the future, please keep in mind that every user-visible text has to be translated into 30 languages. Whenever you expose "DEVEL-ONLY" or something like that to the users please think how it would look in your native language. The fact that one of the documented options didn't work also shows us that MC has never gone through formal testing. -- Regards, Pavel Roskin From proski at gnu.org Mon Nov 12 22:53:14 2001 From: proski at gnu.org (Pavel Roskin) Date: Mon, 12 Nov 2001 17:53:14 -0500 (EST) Subject: MC for Win32 now builds and runs In-Reply-To: <01103022075300.05986@scotty> Message-ID: Hello, Franco! > today I made a breakthrou. Congratulations :-) > The MC Win32 port now > compiles and links with mingw32. > > And it also runs (tested with Win98 and Win2000) > > It still has some severe bug(s) that make it go crash when You try to change > Directory or Drive. > But many things already work (including Find Files, Menues, Dialogs, Info > Panel). That's great. Find Files works thanks to titanic efforts of Andrew Samoilov who eliminated the need to call external egrep. I remember that it didn't work before. > Now I think that the time would be right for some assistance in debuging. > > If someone volenteers ;-) I will provide build-instructions and a > source-patch soon. > > Otherwise I'll first try to make the port a little more stable before doing > so. I have so many other things to do that I'll probably not be able to assist you in debugging, but I'll apply your patches if you document them. -- Regards, Pavel Roskin From proski at gnu.org Mon Nov 12 22:57:39 2001 From: proski at gnu.org (Pavel Roskin) Date: Mon, 12 Nov 2001 17:57:39 -0500 (EST) Subject: "Save file position" in mc editor In-Reply-To: Message-ID: Hello, Alexander! > It would be very nice to add a new feature to mc editor, so it will remember > file positions in each previously opened file, and return to that position > when the file will be opened next time. > This is very common feature of all editors, ide's and even FAR has it. > Are there any plans to do that? There are no plans to do that. You are the first person who asks for this feature. It should be easy to implement. -- Regards, Pavel Roskin From max at tavrida.net Tue Nov 13 01:23:15 2001 From: max at tavrida.net (Max Schedriviy) Date: Tue, 13 Nov 2001 03:23:15 +0200 Subject: "Save file position" in mc editor In-Reply-To: References: Message-ID: <200111130122.fAD1MPIm041355@skif.tavrida.net> On Tue 13 Nov 2001 00:57, Pavel Roskin wrote: > > It would be very nice to add a new feature to mc editor, so it will > > remember file positions in each previously opened file, and return to > > that position when the file will be opened next time. > > This is very common feature of all editors, ide's and even FAR has it. > > Are there any plans to do that? > > There are no plans to do that. You are the first person who asks for this > feature. It should be easy to implement. It was already implemented in my patch some month ago. And I can't work without this feature. When I need to edit big list of sources, it's too hard to search line where you exit from editor. Patch for mc-4.5.55-RELEASE located at ftp://tavrida.net/pub/unix/filemanagers/mc-4.5.55-m1.diff.gz -- C U L8er! Max Schedriviy mailto:max at tavrida.net From avarakin00 at hotmail.com Tue Nov 13 02:05:43 2001 From: avarakin00 at hotmail.com (Alexander Varakin) Date: Mon, 12 Nov 2001 21:05:43 -0500 Subject: "Save file position" in mc editor References: <200111130122.fAD1MPIm041355@skif.tavrida.net> Message-ID: Hi Max, Thanks for publishing the patch! It would be great if anybody with CVS write permissions will apply the Max's patch. Regards, Alex ----- Original Message ----- From: "Max Schedriviy" To: Sent: Monday, November 12, 2001 8:23 PM Subject: Re: "Save file position" in mc editor > On Tue 13 Nov 2001 00:57, Pavel Roskin wrote: > > > > It would be very nice to add a new feature to mc editor, so it will > > > remember file positions in each previously opened file, and return to > > > that position when the file will be opened next time. > > > This is very common feature of all editors, ide's and even FAR has it. > > > Are there any plans to do that? > > > > There are no plans to do that. You are the first person who asks for this > > feature. It should be easy to implement. > It was already implemented in my patch some month ago. And I can't work > without this feature. When I need to edit big list of sources, it's too hard > to search line where you exit from editor. > > Patch for mc-4.5.55-RELEASE located at > ftp://tavrida.net/pub/unix/filemanagers/mc-4.5.55-m1.diff.gz > > -- > C U L8er! > Max Schedriviy mailto:max at tavrida.net > _______________________________________________ > Mc-devel mailing list > Mc-devel at gnome.org > http://mail.gnome.org/mailman/listinfo/mc-devel > From avarakin00 at hotmail.com Tue Nov 13 02:52:34 2001 From: avarakin00 at hotmail.com (Alexander Varakin) Date: Mon, 12 Nov 2001 21:52:34 -0500 Subject: MC for Win32 now builds and runs References: Message-ID: Hi Franco, I am also very interested in win32 port because I work 50% of time in NT and 50% in Unix, so sometimes I type ESC-? in FAR and Alt-F7 in MC :-) Franco, please publish your build instructions, I will try to build it. Which version of mingw32 and glib are you using? Please also publish list of known problems. Regards, Alex ----- Original Message ----- From: "Pavel Roskin" To: "Franco Bez" Cc: Sent: Monday, November 12, 2001 5:53 PM Subject: Re: MC for Win32 now builds and runs > Hello, Franco! > > > today I made a breakthrou. > > Congratulations :-) > > > The MC Win32 port now > > compiles and links with mingw32. > > > > And it also runs (tested with Win98 and Win2000) > > > > It still has some severe bug(s) that make it go crash when You try to change > > Directory or Drive. > > But many things already work (including Find Files, Menues, Dialogs, Info > > Panel). > > That's great. Find Files works thanks to titanic efforts of Andrew > Samoilov who eliminated the need to call external egrep. I remember that > it didn't work before. > > > Now I think that the time would be right for some assistance in debuging. > > > > If someone volenteers ;-) I will provide build-instructions and a > > source-patch soon. > > > > Otherwise I'll first try to make the port a little more stable before doing > > so. > > I have so many other things to do that I'll probably not be able to assist > you in debugging, but I'll apply your patches if you document them. > > -- > Regards, > Pavel Roskin > > _______________________________________________ > Mc-devel mailing list > Mc-devel at gnome.org > http://mail.gnome.org/mailman/listinfo/mc-devel > From max at tavrida.net Tue Nov 13 03:31:27 2001 From: max at tavrida.net (Max Schedriviy) Date: Tue, 13 Nov 2001 05:31:27 +0200 Subject: "Save file position" in mc editor In-Reply-To: References: <200111130122.fAD1MPIm041355@skif.tavrida.net> Message-ID: <200111130330.fAD3UYIm045874@skif.tavrida.net> On Tue 13 Nov 2001 04:05, Alexander Varakin wrote: > Thanks for publishing the patch! > It would be great if anybody with CVS write permissions will apply the > Max's patch. Two month ago I try to commit my patches, but they are "not interesting" for developers. Now I wait version mc w/o gnome to apply some other features, because it's too hard to make something in this ugly code. Without gnome it will be more easier. -- C U L8er! Max Schedriviy mailto:max at tavrida.net From kai at cmail.ru Tue Nov 13 11:55:05 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Tue, 13 Nov 2001 13:55:05 +0200 Subject: "Save file position" in mc editor References: <200111130122.fAD1MPIm041355@skif.tavrida.net> <200111130330.fAD3UYIm045874@skif.tavrida.net> Message-ID: <3BF10A19.D13EB080@cmail.ru> Hi, Max! > Two month ago I try to commit my patches, but they are "not interesting" for > developers. Now I wait version mc w/o gnome to apply some other features, > because it's too hard to make something in this ugly code. Without gnome it > will be more easier. Can you describe these new features? May be they will be in this version. Regards, Andrew. From scottlockwood at hotmail.com Tue Nov 13 12:38:44 2001 From: scottlockwood at hotmail.com (William Scott Lockwood III) Date: Tue, 13 Nov 2001 06:38:44 -0600 Subject: MC for Win32 now builds and runs References: Message-ID: Can someone make a binary available? I'll refrain from the chorus of thank you's this time since someone thinks thanking people for their effort "doesn't count"... Scott ----- Original Message ----- From: "Alexander Varakin" To: "Franco Bez" Cc: Sent: Monday, November 12, 2001 8:52 PM Subject: Re: MC for Win32 now builds and runs > Hi Franco, > > I am also very interested in win32 port because I work 50% of time in NT and > 50% in Unix, so sometimes I type ESC-? in FAR and Alt-F7 in MC :-) > Franco, please publish your build instructions, I will try to build it. > Which version of mingw32 and glib are you using? > Please also publish list of known problems. > > Regards, > Alex > > > ----- Original Message ----- > From: "Pavel Roskin" > To: "Franco Bez" > Cc: > Sent: Monday, November 12, 2001 5:53 PM > Subject: Re: MC for Win32 now builds and runs > > > > Hello, Franco! > > > > > today I made a breakthrou. > > > > Congratulations :-) > > > > > The MC Win32 port now > > > compiles and links with mingw32. > > > > > > And it also runs (tested with Win98 and Win2000) > > > > > > It still has some severe bug(s) that make it go crash when You try to > change > > > Directory or Drive. > > > But many things already work (including Find Files, Menues, Dialogs, > Info > > > Panel). > > > > That's great. Find Files works thanks to titanic efforts of Andrew > > Samoilov who eliminated the need to call external egrep. I remember that > > it didn't work before. > > > > > Now I think that the time would be right for some assistance in > debuging. > > > > > > If someone volenteers ;-) I will provide build-instructions and a > > > source-patch soon. > > > > > > Otherwise I'll first try to make the port a little more stable before > doing > > > so. > > > > I have so many other things to do that I'll probably not be able to assist > > you in debugging, but I'll apply your patches if you document them. > > > > -- > > Regards, > > Pavel Roskin > > > > _______________________________________________ > > Mc-devel mailing list > > Mc-devel at gnome.org > > http://mail.gnome.org/mailman/listinfo/mc-devel > > > > _______________________________________________ > Mc-devel mailing list > Mc-devel at gnome.org > http://mail.gnome.org/mailman/listinfo/mc-devel > From max at tavrida.net Tue Nov 13 12:46:00 2001 From: max at tavrida.net (Max Schedriviy) Date: Tue, 13 Nov 2001 14:46:00 +0200 Subject: "Save file position" in mc editor In-Reply-To: <3BF10A19.D13EB080@cmail.ru> References: <200111130330.fAD3UYIm045874@skif.tavrida.net> <3BF10A19.D13EB080@cmail.ru> Message-ID: <200111131246.fADCk2Im064758@skif.tavrida.net> You wrote: > Can you describe these new features? May be they will be in this version. The minimum that I need - 1) normal ftp plugin 2) working user menu in editor 3) charset recoding in editor 4) make files highlighting configurable 5) fast directory switching (like ^\, but at one click) 6) extended miniinfo (like FAR: +-- cur_dir_size (cur_dir_file_no) ----- disk_free ---+ ) 7) follow text in viewer (like tail) 8) autoupdate directory listing (optional) The maximum that I want - plugin API, like FAR. -- C U L8er sir Max mailto: max at tavrida.net From kai at cmail.ru Tue Nov 13 13:29:37 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Tue, 13 Nov 2001 15:29:37 +0200 Subject: "Save file position" in mc editor References: <200111130330.fAD3UYIm045874@skif.tavrida.net> <3BF10A19.D13EB080@cmail.ru> <200111131246.fADCk2Im064758@skif.tavrida.net> Message-ID: <3BF12041.26BFF234@cmail.ru> > Hi, Max! > > > Can you describe these new features? May be they will be in this version. > The minimum that I need - > 1) normal ftp plugin I use this one from mc-4.5.42. It is not fine, but is more useful than current. BTW, it is no need to wait next release - VFS is not changed. > 2) working user menu in editor Pavel Roskin did something in this direction, please look this list archive. > 3) charset recoding in editor Done in mc-4.5.55. Or you want be able to save file in another charset? > > 4) make files highlighting configurable Can you explain what do you mean? > > 5) fast directory switching (like ^\, but at one click) > 6) extended miniinfo > (like FAR: +-- cur_dir_size (cur_dir_file_no) ----- disk_free ---+ ) > 7) follow text in viewer (like tail) I vote too. > > 8) autoupdate directory listing (optional) > As far as I remember there was a patch to reload directory in configurable interval. > > The maximum that I want - plugin API, like FAR. > It is not so easy, but this one is possible. Regards, Andrew. From max at tavrida.net Tue Nov 13 17:51:52 2001 From: max at tavrida.net (Max Schedriviy) Date: Tue, 13 Nov 2001 19:51:52 +0200 Subject: "Save file position" in mc editor In-Reply-To: <3BF12041.26BFF234@cmail.ru> References: <200111131246.fADCk2Im064758@skif.tavrida.net> <3BF12041.26BFF234@cmail.ru> Message-ID: <200111131751.fADHprIm076414@skif.tavrida.net> Andrew V. Samoilov wrote: > > The minimum that I need - > > 1) normal ftp plugin > I use this one from mc-4.5.42. It is not fine, but is more useful than > current. BTW, it is no need to wait next release - VFS is not changed. May be. I just write that I want to see. > > 2) working user menu in editor > Pavel Roskin did something in this direction, please look this list > archive. I know, but it did not work :) > > 3) charset recoding in editor > Done in mc-4.5.55. Or you want be able to save file in another charset? Yes, it's easier then type `recode -wk file1>file2; mv file2 file1` > > 4) make files highlighting configurable > Can you explain what do you mean? My patch allow highlight files by extension. Archives to one color, sources to other etc. But extensions are compiled in binary, and not configurable in run-time. I want to make two things: - make highlighting by regexps (not by extensions), and optionally by first chars of context. - make it configurable through config file. This feature just make navigation easier. > > 8) autoupdate directory listing (optional) > As far as I remember there was a patch to reload directory in configurable > interval. I made this, but it's too buggy, and I have no time to fix bugs. May be in future. > > The maximum that I want - plugin API, like FAR. > It is not so easy, but this one is possible. It can solve many problems. Module structure more flexible in developing. PS. I forget about macroses... :) -- C U L8er sir Max mailto: max at tavrida.net From polyama at yahoo.com Tue Nov 13 19:42:53 2001 From: polyama at yahoo.com (Maksym Polyakov) Date: Tue, 13 Nov 2001 13:42:53 -0600 Subject: "Save file position" in mc editor In-Reply-To: <3BF12041.26BFF234@cmail.ru> References: <200111130330.fAD3UYIm045874@skif.tavrida.net> <3BF10A19.D13EB080@cmail.ru> <200111131246.fADCk2Im064758@skif.tavrida.net> <3BF12041.26BFF234@cmail.ru> Message-ID: <20011113134252.B25631@virginia.forestry.auburn.edu> Hi, Andrew On Tue, Nov 13, 2001 at 03:29:37PM +0200, Andrew V. Samoilov (AVS) wrote: AVS> > 3) charset recoding in editor AVS> Done in mc-4.5.55. Could you explain, please? -- ?????? ??????? From franco.bez at web.de Wed Nov 14 05:13:21 2001 From: franco.bez at web.de (Franco Bez) Date: Wed, 14 Nov 2001 06:13:21 +0100 Subject: MC for Win32 now builds and runs In-Reply-To: References: Message-ID: <01111406132100.00821@scotty> Am Dienstag, 13. November 2001 13:38 schrieb William Scott Lockwood III: > Can someone make a binary available? I'll refrain from the chorus of thank > you's this time since someone thinks thanking people for their effort > "doesn't count"... Don't take it wrong - "doesn't count" in helping development, maybe. > Scott I will make a binary available when it's a little more stable, meanwhile you can get my 4.1.36 based MC-Win32-binary at http://home.a-ctiy.de/franco.bez/mc/mc.html Ciao, Franco From franco.bez at web.de Wed Nov 14 05:15:52 2001 From: franco.bez at web.de (Franco Bez) Date: Wed, 14 Nov 2001 06:15:52 +0100 Subject: MC for Win32 now builds and runs In-Reply-To: References: Message-ID: <01111406155201.00821@scotty> Am Dienstag, 13. November 2001 03:52 schrieb Alexander Varakin: > Hi Franco, > > I am also very interested in win32 port because I work 50% of time in NT > and 50% in Unix, so sometimes I type ESC-? in FAR and Alt-F7 in MC :-) > Franco, please publish your build instructions, I will try to build it. I'll first have to write those instructions down. > Which version of mingw32 and glib are you using? > Please also publish list of known problems. I will, maybe the weekend ... > Regards, > Alex Ciao, Franco From kai at cmail.ru Wed Nov 14 08:32:36 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Wed, 14 Nov 2001 10:32:36 +0200 Subject: "Save file position" in mc editor References: <200111130330.fAD3UYIm045874@skif.tavrida.net> <3BF10A19.D13EB080@cmail.ru> <200111131246.fADCk2Im064758@skif.tavrida.net> <3BF12041.26BFF234@cmail.ru> <20011113134252.B25631@virginia.forestry.auburn.edu> Message-ID: <3BF22C24.A6C0C9D6@cmail.ru> Hi, Maksym! > On Tue, Nov 13, 2001 at 03:29:37PM +0200, Andrew V. Samoilov (AVS) wrote: > AVS> > 3) charset recoding in editor > AVS> Done in mc-4.5.55. > > Could you explain, please? Well, I mean multiple codepages support, but not recoding. Regards, Andrew. From kai at cmail.ru Wed Nov 14 12:54:12 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Wed, 14 Nov 2001 14:54:12 +0200 Subject: [smbfs]: --with-codepagedir & --with-configdir added Message-ID: <20011114145412.A2173@bcs.zp.ua> Hello! I backport these option from samba 2.2.2 and adjusted vfs/samba/Makefile.in and vfs/samba/acconfig.h. --with-configdir is useless now, but I think add this option to mc's configure and use in vfs/smbfs.c. Regards, Andrew. ChangeLog: * samba/lib/system.c (sys_chroot): Removed. * samba/configure.in: Remove RUNPROG. Don't check for chroot and execl functions. Remove syslog logging support. Add --with-codepagedir and --with-configdir from samba 2.2.2. * samba/Makefile.in: Use configdir and codepagedir. From proski at gnu.org Wed Nov 14 19:35:11 2001 From: proski at gnu.org (Pavel Roskin) Date: Wed, 14 Nov 2001 14:35:11 -0500 (EST) Subject: MC for Win32 now builds and runs In-Reply-To: <01111406132100.00821@scotty> Message-ID: On Wed, 14 Nov 2001, Franco Bez wrote: > Am Dienstag, 13. November 2001 13:38 schrieb William Scott Lockwood III: > > Can someone make a binary available? I'll refrain from the chorus of thank > > you's this time since someone thinks thanking people for their effort > > "doesn't count"... > > Don't take it wrong - "doesn't count" in helping development, maybe. Correct. Sorry if my words offended anyone. -- Regards, Pavel Roskin From proski at gnu.org Wed Nov 14 20:33:38 2001 From: proski at gnu.org (Pavel Roskin) Date: Wed, 14 Nov 2001 15:33:38 -0500 (EST) Subject: Filtered view (M!) works again In-Reply-To: <20011108110300.A371@bcs.zp.ua> Message-ID: Hi, Andrew! On Thu, 8 Nov 2001, Andrew V. Samoilov wrote: > Hi, Pavel! > > This patch makes "Filtered view" (M-!) feature work again > and fixes memory leak. It was broken recently with file > type checks. Thank you and sorry that I broke it. I'm sorry for the late reply. I didn't realize that you haven't applied your patch yet. I'm applying it now with a small warning fix (gcc wrongly thinks that fd may be uninitialized). > P.S. Some days ago I mailed --enable-largefile vs smbfs > is fixed. It is not so. > sizeof (off_t) == 8 in MC but 4 in samba. Please feel free to fix samba support. -- Regards, Pavel Roskin From proski at gnu.org Wed Nov 14 20:44:48 2001 From: proski at gnu.org (Pavel Roskin) Date: Wed, 14 Nov 2001 15:44:48 -0500 (EST) Subject: Panelize and sort - some fixes Message-ID: Hello! I have fixed sorting of the entries in the panelize mode (both after "find file" and "external panelize"). Now you don't have to reselect "Sort Order" in the menu to "actualize" the desired order - the entries will be sorted from the beginning. I also have fixed a bug that caused incorrect sorting on panels without "..", which happens in the panelize mode. The first entry was excluded from sort, regardless of whether it's ".." or not. Now it's sorted together with other entries. * dir.c (do_sort): Correctly handle the case when there is no ".." entry (i.e. panelized mode). * panelize.c (do_external_panelize): Re-sort the panel according to the current settings. * find.c (do_find): Re-sort the panel according to the current settings when doing panelizing. --------------------------------- --- dir.c +++ dir.c @@ -316,10 +316,12 @@ void do_sort (dir_list *list, sortfn *sort, int top, int reverse_f, int case_sensitive_f) { int i; + int dot_dot_found = 0; file_entry tmp_fe; for (i = 0; i < top + 1; i++) { /* put ".." first in list */ if (!strcmp (list->list [i].fname, "..")) { + dot_dot_found = 1; if (i > 0) { /* swap [i] and [0] */ memcpy (&tmp_fe, &(list->list [0]), sizeof (file_entry)); memcpy (&(list->list [0]), &(list->list [i]), sizeof (file_entry)); @@ -331,7 +333,8 @@ do_sort (dir_list *list, sortfn *sort, i reverse = reverse_f ? -1 : 1; case_sensitive = case_sensitive_f; - qsort (&(list->list) [1], top, sizeof (file_entry), sort); + qsort (&(list->list) [dot_dot_found], + top + 1 - dot_dot_found, sizeof (file_entry), sort); } void --- find.c +++ find.c @@ -993,6 +993,7 @@ do_find (void) if (v == B_PANELIZE){ if (dir_and_file_set){ try_to_select (cpanel, NULL); + panel_re_sort (cpanel); paint_panel (cpanel); } break; --- panelize.c +++ panelize.c @@ -448,5 +448,6 @@ void do_external_panelize (char *command message (0, _("External panelize"), _("Pipe close failed")); close_error_pipe (0, 0); try_to_select (cpanel, NULL); + panel_re_sort (cpanel); paint_panel (cpanel); } --------------------------------- -- Regards, Pavel Roskin From proski at gnu.org Wed Nov 14 22:02:41 2001 From: proski at gnu.org (Pavel Roskin) Date: Wed, 14 Nov 2001 17:02:41 -0500 (EST) Subject: "Save file position" in mc editor In-Reply-To: <200111130122.fAD1MPIm041355@skif.tavrida.net> Message-ID: Hello, Max! > > > It would be very nice to add a new feature to mc editor, so it will > > > remember file positions in each previously opened file, and return to > > > that position when the file will be opened next time. > > > This is very common feature of all editors, ide's and even FAR has it. > > > Are there any plans to do that? > > > > There are no plans to do that. You are the first person who asks for this > > feature. It should be easy to implement. > It was already implemented in my patch some month ago. And I can't work > without this feature. When I need to edit big list of sources, it's too hard > to search line where you exit from editor. > > Patch for mc-4.5.55-RELEASE located at > ftp://tavrida.net/pub/unix/filemanagers/mc-4.5.55-m1.diff.gz Ok, I was wrong about the "first person" then. But your patch includes other features, some of them need to be discussed separately. By the way, look up "notch" in the dictionary. You use of this word is very confusing. I tried to extract the code responsible for saving the file position but gave up. It's so poorly written (using fixed size buffers) that it's easier to rewrite it from scratch. By the way, the snapshots from CVS are posted at http://www.red-bean.com/~proski/mc/ The snapshots don't contain GNOME code. It would be easier to integrate your patches if you base them on the current code. -- Regards, Pavel Roskin From max at tavrida.net Thu Nov 15 07:42:25 2001 From: max at tavrida.net (Max Schedriviy) Date: Thu, 15 Nov 2001 09:42:25 +0200 Subject: "Save file position" in mc editor In-Reply-To: References: Message-ID: <200111150741.fAF7fSIm060534@skif.tavrida.net> On Thu 15 Nov 2001 00:02, Pavel Roskin wrote: > Ok, I was wrong about the "first person" then. But your patch includes > other features, some of them need to be discussed separately. Some time ago I send separated patches and they was discussed, but not commited. > By the way, look up "notch" in the dictionary. You use of this word is > very confusing. I don't remember, why I use this "word". :) > I tried to extract the code responsible for saving the file position but > gave up. It's so poorly written (using fixed size buffers) that it's > easier to rewrite it from scratch. I know, that it's very bad written. But it was enough for me. > By the way, the snapshots from CVS are posted at > http://www.red-bean.com/~proski/mc/ > The snapshots don't contain GNOME code. It would be easier to integrate > your patches if you base them on the current code. Ok, I see. -- C U L8er! Max Schedriviy mailto:max at tavrida.net From kai at cmail.ru Thu Nov 15 10:01:23 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Thu, 15 Nov 2001 12:01:23 +0200 Subject: Filtered view (M!) works again In-Reply-To: References: <20011108110300.A371@bcs.zp.ua> Message-ID: <20011115120123.A372@bcs.zp.ua> Hi, Pavel! On Wed, Nov 14, 2001 at 03:33:38PM -0500, Pavel Roskin wrote: > Hi, Andrew! > > On Thu, 8 Nov 2001, Andrew V. Samoilov wrote: > > > Hi, Pavel! > > > > This patch makes "Filtered view" (M-!) feature work again > > and fixes memory leak. It was broken recently with file > > type checks. > > Thank you and sorry that I broke it. > > I'm sorry for the late reply. I didn't realize that you haven't applied > your patch yet. I'm applying it now with a small warning fix (gcc wrongly > thinks that fd may be uninitialized). Well, it was a reason I did not commit this patch. Unfortunately it really can be used uninitialized. There is at least one place (in layout.c, quick view) where view_init called with command => NULL and file => "". Another unpleasant discovery was: mc_open ("", ...) and mc_stat ("", ...) operate with current directory and return usually someting but not -1. > > P.S. Some days ago I mailed --enable-largefile vs smbfs > > is fixed. It is not so. > > sizeof (off_t) == 8 in MC but 4 in samba. > > Please feel free to fix samba support. It seems it is more easy to rewrite it from scratch with libsmbclient URL syntax: smb://[[[domain;]user[:password@]]server[/share[/path[/file]]]] and other good stuffs. -- Regards, Andrew. From ruysan at wanadoo.es Thu Nov 15 19:35:33 2001 From: ruysan at wanadoo.es (Rodrigo Sancho Senosiain) Date: Thu, 15 Nov 2001 20:35:33 +0100 Subject: File descriptions in MC Message-ID: <20011115203533.A12190@hal9005r> Hello. I would like to know if someone is working, or wants to work, on having file descriptions (descript.ion like in 4DOS) support on MC. I wrote to Max Schedriviy, who has no time to do it now, so he suggested I asked on this list. I'll try to do it myself, but my C skills are limited and I've never hacked on mc (although I'm a daily user, of course) so I don't know the internals. But I would help with testing and bug-fixing as long as my knowledge reaches. At least I would appreciate very much some advices from the developers about which files, structures, etc.. should I study to try to implement this feature myself. Thanks a lot. -- Rodrigo Sancho Senosiain FidoNet 2:341/66.26 ruysan at wanadoo.es From franco.bez at web.de Sun Nov 18 07:50:57 2001 From: franco.bez at web.de (Franco Bez) Date: Sun, 18 Nov 2001 08:50:57 +0100 Subject: patch: MC for Win32 In-Reply-To: <01111406132100.00821@scotty> References: <01111406132100.00821@scotty> Message-ID: <01111808505700.01414@scotty> Hi all, so here's my patch for mc on Win32. Note : - I took a CVS checkout from 27.Okt as a basis - MC for Win32 is still far from beeing stable. - Currently ONLY mingw32 (gcc for Win32) is supported - You also need glib from Tor Lillqvist's "Gimp for Win32" site - You also need gettext ( i.e. my gettext port http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html ) After applying my patch ( running $> gzip -dc patch-mc-win32.gz | patch -p1 in the mc source directory ) You can build mc.exe by changing to the pc subdir and run $> make -fMakefile.MIN ************************************ I added the two files mc/pc/regex.c mc/pc/regex.h from the mc-4.1.36 distribution. This is just a quick fix. As the new distribution no longer contains mc/src/regex.h and mc/src/regex.c was giving trouble. ******************************************* the mingw32 toolchain I use is based on gcc-2.95.2-1 , winapi-0.1.5 , mingw-runtime-20000203 I built it from source on my Linux box. it uses "msvcrt" as c-runtime library. Later versions of mingw should do just fine. Additionally I'm using my gettext-port (http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html). ******************************************* glib was downloaded from Tor Lillqvist's "Gimp for Win32" site. packages needed: glib-dev-20001226.zip libiconv-dev-20001007.zip these packages contain the Headers, Libs and Win32 Dlls. the header-files are a problem when using a UN*X based mingw-cross-compiler. they contain CR/LF line termiation. In order to convert them to the UN*X style LF line termination a tool like dos2unix is required. **************************************** What follows are the comments to my patch. Ciao, Franco **************************************** mc/edit/edit.c - Open file in binary mode on Win32 platforms. mc/pc/Makefile.MIN - removed ".exe" from mingw-binary names to make build possible on cross-compilers - fixed compiler and linker flags for use of glib and gettext - fixed order of flags for linking mc.exe mc/pc/Makefile.PC - added/removed files to/from build mc/pc/chmod.c - fixed includes for cross-compiler - added gettext N_() and _() makro calls mc/pc/config.h - a few fixes mc/pc/cons_nt.c - changes regarding the calculation of the size of the console window on Win32 fixes a bug with Win2k mc/pc/dirent.h - added comment that file seems to be no longer needed mc/pc/drive.c - added gettext N_() and _() makro calls - added workaround for a crash that happens when Changing drive while panel not in DirListing mode mc/pc/key_nt.c - fixed a problem with AltGr Key - added/changed dummy functions (mouse dummys) mc/pc/slint_pc.c - added comment -> DO NOT USE GETTEXT HERE mc/pc/util_nt.c - fixed includes - added gettext N_() and _() makro calls - fixed problem with the display of free disc space - added dummy functions mc/slang/slerr.c - fixed includes mc/slang/slgetkey.c - fixed includes mc/slang/slsmg.c - fixed includes mc/slang/sltermin.c - fixed includes mc/slang/slvideo.c - fixed includes - changes regarding the calculation of the size of the console window on Win32 fixes a bug with Win2k mc/slang/slw32tty.c - fixed includes - changes regarding the calculation of the size of the console window on Win32 fixes a bug with Win2k - added dummy functions mc/src/cmd.c - fixed includes mc/src/command.c - added handling of internal SET command for Win32 mc/src/ext.c - no shellbang in temporary command file on windows mc/src/file.c - fixed includes - commented out the detection of cyclic symlinks on Win32 this is only a Quick Fix mc/src/global.h - fixed includes mc/src/main.c - fixed includes - director_history_add is broken on Win32 - mc crashes - made it a dummy function on Win32 THIS definately has to be fixed - made init_xterm_support a dummy on Win32 - there is no xterm there - made mc ignore Ctrl-C breaks on Win32 - defined the gettext LOCALEDIR for Win32 - added comment that gfree(home_dir); might no longer be needed on Win32 mc/src/myslang.h - fixed includes mc/src/treestore.c - commented out process_special_dirs (&special_dirs, CONFDIR "mc.global"); for Win32 mc/src/user.h - fixed includes mc/src/util.c - fixed includes - fixed parameters for bizp2 might be also needed for other platforms - fixed TEMPDIR for Win32 mc/vfs/vfs.h - fixed includes -------------- next part -------------- A non-text attachment was scrubbed... Name: patch-mc-win32.gz Type: application/x-gzip Size: 9501 bytes Desc: my patches URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: regex.c.gz Type: application/x-gzip Size: 46534 bytes Desc: Add this file to the pc subdir URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: regex.h.gz Type: application/x-gzip Size: 6279 bytes Desc: Add this file to the pc subdir URL: From proski at gnu.org Mon Nov 19 23:51:25 2001 From: proski at gnu.org (Pavel Roskin) Date: Mon, 19 Nov 2001 18:51:25 -0500 (EST) Subject: patch: MC for Win32 In-Reply-To: <01111808505700.01414@scotty> Message-ID: Hello, Franco! > so here's my patch for mc on Win32. Thank you very much! I appreciate that you documented your changes so carefully. I'm quite overwhelmed with work now and the worst thing is that I still have no internet at home (Verizon doesn't consider it as critical as phone connection), so it will take some time before I apply your changes. Just some quick notes about one of your comments. > - You also need gettext ( i.e. my gettext port > http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html ) What if we disable NLS support for now until gettext is ported properly to Win32? Extra dependencied mean extra hurdles for potential developers. > I added the two files > > mc/pc/regex.c > mc/pc/regex.h > > from the mc-4.1.36 distribution. > This is just a quick fix. > As the new distribution no longer contains > mc/src/regex.h > and > mc/src/regex.c > was giving trouble. That's not true. src/regex.c is still there. src/regex.h has been renamed to src/eregex.h (it looks like that, there are no ChangeLog entries). I believe that you should have regex in the system library as well. The files included with MC are only used for some GNU-specific things. > the mingw32 toolchain I use is > based on gcc-2.95.2-1 , winapi-0.1.5 , mingw-runtime-20000203 > I built it from source on my Linux box. > it uses "msvcrt" as c-runtime library. That's very encouraging. No need to use Windows to compile MC for Windows :-) -- Regards, Pavel Roskin From franco.bez at web.de Tue Nov 20 10:35:36 2001 From: franco.bez at web.de (franco.bez at web.de) Date: Tue, 20 Nov 2001 11:35:36 +0100 Subject: patch: MC for Win32 Message-ID: <200111201035.fAKAZak12231@mailgate5.cinetic.de> > Pavel Roskin schrieb am 20.11.01: > Hello, Franco! > >> so here's my patch for mc on Win32. > > Thank you very much! I appreciate that you documented your changes so > carefully. I'm quite overwhelmed with work now and the worst thing is > that I still have no internet at home (Verizon doesn't consider it as > critical as phone connection), so it will take some time before I apply > your changes. No problem. > Just some quick notes about one of your comments. >> >> - You also need gettext ( i.e. my gettext port >> http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html ) >> > What if we disable NLS support for now until gettext is ported properly to > Win32? Extra dependencied mean extra hurdles for potential developers. We could make this optional - a few lines of comment in the Makefile on HOW TO enable/disable NLS (gettext) and disabling it by default is maybe best. What do You mean by "unitl gettext is properly ported" - is my port not proper enough ? There are at least two other ports we could use. BTW: who is currently maintaining the german translation of MC ? There are several things that should be fixed/improved there. >> I added the two files >> >> mc/pc/regex.c >> mc/pc/regex.h >> >> from the mc-4.1.36 distribution. >> This is just a quick fix. >> As the new distribution no longer contains >> mc/src/regex.h >> and >> mc/src/regex.c >> was giving trouble. > > That's not true. src/regex.c is still there. Yes - like I said - it was just giving trouble. > src/regex.h has been > renamed to src/eregex.h (it looks like that, there are no ChangeLog > entries). I will try with src/eregex.h and src/regex.c > I believe that you should have regex in the system library as well. I will check this , but I believe mingw doesn't have regex, as it uses the M$ runtime library. > The > files included with MC are only used for some GNU-specific things. >> the mingw32 toolchain I use is >> based on gcc-2.95.2-1 , winapi-0.1.5 , mingw-runtime-20000203 >> I built it from source on my Linux box. >> it uses "msvcrt" as c-runtime library. > > That's very encouraging. No need to use Windows to compile MC for > Windows > :-) That is true, NO NEED TO USE WINDOWS FOR DEVELOPMENT, even for testing MC for Win32 the Windows Emulator (WINE) might be sufficiant. (I have not yet tested MC.exe with WINE.) > -- > Regards, > Pavel Roskin Ciao, Franco ____________________________________________________ Berufsunf?higskeitversicherung von Mamax bei WEB.DE. Jetzt informieren! http://bu.web.de From proski at gnu.org Tue Nov 20 16:10:21 2001 From: proski at gnu.org (Pavel Roskin) Date: Tue, 20 Nov 2001 11:10:21 -0500 (EST) Subject: patch: MC for Win32 In-Reply-To: <200111201035.fAKAZak12231@mailgate5.cinetic.de> Message-ID: Hello, Franco! > > What if we disable NLS support for now until gettext is ported properly to > > Win32? Extra dependencied mean extra hurdles for potential developers. > > We could make this optional - a few lines of comment in the Makefile > on HOW TO enable/disable NLS (gettext) and disabling it by default is maybe best. > > What do You mean by "unitl gettext is properly ported" - is my port > not proper enough ? There are at least two other ports we could use. Sorry, I didn't mean it. I meant something officially supported by the maintainers of gettext. But it shouldn't matter too much as long as people can find it. > BTW: who is currently maintaining the german translation of MC ? > There are several things that should be fixed/improved there. I don't think there is a maintainer. de.po says that it's Christian Meyer , but the "Last-Translator" field is not updated automatically. You can send me the new translation and I'll put it on CVS. You can also research the GNOME website on how to get write access to the translation files on GNOME CVS. -- Regards, Pavel Roskin From franco.bez at web.de Tue Nov 20 16:27:43 2001 From: franco.bez at web.de (franco.bez at web.de) Date: Tue, 20 Nov 2001 17:27:43 +0100 Subject: patch: MC for Win32 Message-ID: <200111201627.fAKGRhk08544@mailgate5.cinetic.de> > Pavel Roskin schrieb am 20.11.01: > Hello, Franco! > > > > What if we disable NLS support for now until gettext is ported properly to > > > Win32? Extra dependencied mean extra hurdles for potential developers. > > > > We could make this optional - a few lines of comment in the Makefile > > on HOW TO enable/disable NLS (gettext) and disabling it by default is maybe best. > > > > What do You mean by "unitl gettext is properly ported" - is my port > > not proper enough ? There are at least two other ports we could use. > > Sorry, I didn't mean it. I meant something officially supported by the > maintainers of gettext. But it shouldn't matter too much as long as > people can find it. gettext is AFAIK now part of glibc. I had a short conversation with the last maintainer of the standalone gettext (0.10.35) release, and asked him if he was interrested in my gettext port. - The short answer was - NO . > > BTW: who is currently maintaining the german translation of MC ? > > There are several things that should be fixed/improved there. > > I don't think there is a maintainer. de.po says that it's Christian Meyer > , but the "Last-Translator" field is not updated automatically. > > You can send me the new translation and I'll put it on CVS. You can also > research the GNOME website on how to get write access to the translation > files on GNOME CVS. Ok - I will when I have them ready. > -- > Regards, > Pavel Roskin Ciao, Franco ____________________________________________________ Berufsunf?higskeitversicherung von Mamax bei WEB.DE. Jetzt informieren! http://bu.web.de From nerijus at users.sourceforge.net Wed Nov 21 00:41:13 2001 From: nerijus at users.sourceforge.net (Nerijus Baliunas) Date: Wed, 21 Nov 2001 02:41:13 +0200 (EET) Subject: zipfs Message-ID: <20011121005003.4F3028F672@mail.delfi.lt> Hello, There is a problem with zipfs - if I enter some zip archive and view some file (press F3 inside it), zip archive's date changes to current date. Regards, Nerijus From avarakin00 at hotmail.com Wed Nov 21 04:16:31 2001 From: avarakin00 at hotmail.com (Alexander Varakin) Date: Tue, 20 Nov 2001 23:16:31 -0500 Subject: patch: MC for Win32 References: Message-ID: Hi Pavel, Franco, Would it be possible to put Franco's patches into the CVS today or tomorrow, so people (including me) will be able to start testing the port after eating some turkey :-) Even though this patch is maybe not very stable at the moment, it won't harm since it is independent from the rest of the code. Alex ----- Original Message ----- From: "Pavel Roskin" To: Cc: Sent: Tuesday, November 20, 2001 11:10 AM Subject: Re: Re: patch: MC for Win32 > Hello, Franco! > > > > What if we disable NLS support for now until gettext is ported properly to > > > Win32? Extra dependencied mean extra hurdles for potential developers. > > > > We could make this optional - a few lines of comment in the Makefile > > on HOW TO enable/disable NLS (gettext) and disabling it by default is maybe best. > > > > What do You mean by "unitl gettext is properly ported" - is my port > > not proper enough ? There are at least two other ports we could use. > > Sorry, I didn't mean it. I meant something officially supported by the > maintainers of gettext. But it shouldn't matter too much as long as > people can find it. > > > BTW: who is currently maintaining the german translation of MC ? > > There are several things that should be fixed/improved there. > > I don't think there is a maintainer. de.po says that it's Christian Meyer > , but the "Last-Translator" field is not updated > automatically. > > You can send me the new translation and I'll put it on CVS. You can also > research the GNOME website on how to get write access to the translation > files on GNOME CVS. > > -- > Regards, > Pavel Roskin > > _______________________________________________ > Mc-devel mailing list > Mc-devel at gnome.org > http://mail.gnome.org/mailman/listinfo/mc-devel > From proski at gnu.org Wed Nov 21 22:59:06 2001 From: proski at gnu.org (Pavel Roskin) Date: Wed, 21 Nov 2001 17:59:06 -0500 (EST) Subject: patch: MC for Win32 In-Reply-To: Message-ID: On Tue, 20 Nov 2001, Alexander Varakin wrote: > Hi Pavel, Franco, > > Would it be possible to put Franco's patches into the CVS today or tomorrow, > so people (including me) will be able to start testing the port after eating > some turkey :-) > Even though this patch is maybe not very stable at the moment, it won't harm > since it is independent from the rest of the code. Sorry, I didn't have time today an I must go. I'll be back on Monday only :-( You'll have to apply the patch by hand for now. -- Regards, Pavel Roskin From kai at cmail.ru Wed Nov 28 10:43:06 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Wed, 28 Nov 2001 12:43:06 +0200 Subject: Multiscreen patch ported to CVS. Message-ID: <3C04BFBA.6040204@cmail.ru> Hi! I ported Walery's Multiscreen patch to CVS version. It can be uploaded from http://www.linux.zp.ua/mc/mc-cvs-multiscreen-0.6.patch.gz. It based on http://www.sama.ru/~despair/mc/mc-multiscreen+bookmarks-patch-0.5.tar.gz for mc 4.5.55. I added autoconf (--enable-dlgswitch) and automake support, fixed compilation with egcs-1.1.2 and some features. It is compiled but I had no time to test it hardly. Known bug in built-in editor: if you edit file with relative filename (common place with F4) and switch to file manager and change directory, this file will be saved relative your current directory. There is a dir field in WEdit structure, but it is not used properly. Regards, Andrew. P.S. I am going to Moscow tomorrow for 2-3 weeks and will have limited access to Internet this time. From kai at cmail.ru Wed Nov 28 12:57:26 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Wed, 28 Nov 2001 14:57:26 +0200 Subject: Syntax file crush mc Message-ID: <20011128145726.A16397@it.efp.com.ua> Hi! Some minutes ago I committed patch below. This one fixes crush in built-in editor with syntax highlighting if Syntax file contain lines like \s+ \n lightgray/13 red But this 4 line Syntax file and many others still crush mc. # syntax rules version 62 file .\*ChangeLog$ GNU\sDistribution\sChangeLog\sFile # context [\ \t]+ \n lightgray/13 # end of Syntax. (Hopeless attempt to highlight trailing whitespace(s)). It seems something corrupts stack in syntax.c. Unfortunately I have no time to hint this bug. I am going to Moscow for 2-3 weeks and will have limited access to Internet. Regards, Andrew. Index: mc/edit/ChangeLog diff -u mc/edit/ChangeLog:1.29 mc/edit/ChangeLog:1.30 --- mc/edit/ChangeLog:1.29 Tue Nov 27 07:38:30 2001 +++ mc/edit/ChangeLog Wed Nov 28 07:40:18 2001 @@ -1,3 +1,19 @@ +2001-11-28 Andrew V. Samoilov + + * syntax.c (apply_rules_going_right): Fix crush for lines like + \s+ \n lightgray/13 red + in Syntax file. + (read_one_line): Use EOF instead of -1. + (get_args): Fix buffer overflow for l without trailing + whitespace(s). + (break_a): New macro. + (edit_read_syntax_rules): Use break_a to fix memory leaks. + (edit_load_syntax): Eliminate s and use message to prevent + buffer overflow. + + * editdraw.c (edit_render): Eliminate f. It's only written + but never read. + 2001-11-27 Andrew V. Samoilov * editmenu.c (edit_wrap_cmd): Use g_free() on the result Index: mc/edit/syntax.c diff -u mc/edit/syntax.c:1.17 mc/edit/syntax.c:1.18 --- mc/edit/syntax.c:1.17 Tue Sep 11 17:44:52 2001 +++ mc/edit/syntax.c Wed Nov 28 07:40:18 2001 @@ -238,6 +238,7 @@ if (!_rule.keyword) { char *p; p = (r = edit->rules[_rule.context])->keyword_first_chars; + if (p) while (*(p = xx_strchr ((unsigned char *) p + 1, c))) { struct key_word *k; int count; @@ -402,7 +403,7 @@ #endif for (;;) { c = fgetc (f); - if (c == -1) { + if (c == EOF) { if (errno == EINTR) continue; r = 0; @@ -493,14 +494,15 @@ static void get_args (char *l, char **args, int *argc) { *argc = 0; - l--; for (;;) { - char *p; - for (p = l + 1; *p && whiteness (*p); p++); + char *p = l; + while (*p && whiteness (*p)) + p++; if (!*p) break; for (l = p + 1; *l && !whiteness (*l); l++); - *l = '\0'; + if (*l) + *l++ = '\0'; *args = strdup_convert (p); (*argc)++; args++; @@ -512,11 +514,11 @@ { while (*args) { syntax_free (*args); - *args = 0; args++; } } +#define break_a {result=line;break;} #define check_a {if(!*a){result=line;break;}} #define check_not_a {if(*a){result=line;break;}} @@ -653,8 +655,7 @@ check_a; if (num_contexts == -1) { if (strcmp (*a, "default")) { /* first context is the default */ - *a = 0; - check_a; + break_a; } a++; c = r[0] = syntax_malloc (sizeof (struct context_rule)); @@ -724,7 +725,7 @@ } else if (!strcmp (args[0], "keyword")) { struct key_word *k; if (num_words == -1) - *a = 0; + break_a; check_a; k = r[num_contexts - 1]->keyword[num_words] = syntax_malloc (sizeof (struct key_word)); if (!strcmp (*a, "whole")) { @@ -745,8 +746,7 @@ } check_a; if (!strcmp (*a, "whole")) { - *a = 0; - check_a; + break_a; } k->keyword = (char *) strdup (*a++); k->first = *k->keyword; @@ -768,8 +768,7 @@ } else if (!strcmp (args[0], "file")) { break; } else { /* anything else is an error */ - *a = 0; - check_a; + break_a; } free_args (args); syntax_free (l); @@ -998,10 +997,10 @@ return; } if (r) { - char s[80]; edit_free_syntax_rules (edit); - sprintf (s, _ (" Error in file %s on line %d "), error_file_name ? error_file_name : f, r); - edit_error_dialog (_ (" Load syntax file "), s); + message (0, _(" Load syntax file "), + _(" Error in file %s on line %d "), + error_file_name ? error_file_name : f, r); syntax_free (error_file_name); return; } From kai at cmail.ru Wed Nov 28 15:44:47 2001 From: kai at cmail.ru (Andrew V. Samoilov) Date: Wed, 28 Nov 2001 17:44:47 +0200 Subject: Syntax file crash mc: probable fixed Message-ID: <20011128174447.A673@it.efp.com.ua> Hi, Pavel! This patch fixes crushes in built-in editor with incorrect Syntax file(s). Unfortunately I have not time to test it hardly. In worse scenario I will be offline for a 3 weeks, so commit it please if you find it right. I am too harry now to make sure I break nothing. Regards, Andrew. ChangeLog: * syntax.c (syntax_g_free): New macros. Use to release and NULLify glib allocated memory area(s). (strdup_convert): Rename to ... (convert): ... this. Don't strdup passed string. (get_args): Use convert instead of strdup_convert. (free_args): Make it do notning macros. (open_include_file): Eliminate p array. Use glib functions to construct error_file_name. Use PATH_SEP_STR instead of "/". (edit_read_syntax_rules): Use syntax_g_free to release error_file_name. (edit_load_syntax): Likewise. --- mc-cvs/edit/syntax.c Wed Nov 28 17:15:06 2001 +++ mc/edit/syntax.c Wed Nov 28 17:17:37 2001 @@ -68,6 +68,7 @@ static void *syntax_malloc (size_t x) } #define syntax_free(x) {if(x){free(x);(x)=0;}} +#define syntax_g_free(x) {if(x){g_free(x);(x)=0;}} static long compare_word_to_right (WEdit * edit, long i, char *text, char *whole_left, char *whole_right, int line_start) { @@ -428,10 +429,10 @@ static int read_one_line (char **line, F return r; } -static char *strdup_convert (char *s) +static char *convert (char *s) { char *r, *p; - p = r = (char *) strdup (s); + p = r = s; while (*s) { switch (*s) { case '\\': @@ -503,13 +505,13 @@ static void get_args (char *l, char **ar for (l = p + 1; *l && !whiteness (*l); l++); if (*l) *l++ = '\0'; - *args = strdup_convert (p); + *args = convert (p); (*argc)++; args++; } *args = 0; } - +#if 0 static void free_args (char **args) { while (*args) { @@ -517,6 +519,9 @@ static void free_args (char **args) args++; } } +#else +#define free_args(x) +#endif #define break_a {result=line;break;} #define check_a {if(!*a){result=line;break;}} @@ -557,25 +562,23 @@ extern char *mc_home; static FILE *open_include_file (char *filename) { FILE *f; - char p[MAX_PATH_LEN]; - syntax_free (error_file_name); - error_file_name = (char *) strdup (filename); + + syntax_g_free (error_file_name); + error_file_name = g_strdup (filename); if (*filename == '/') return fopen (filename, "r"); - strcpy (p, home_dir); - strcat (p, EDIT_DIR "/"); - strcat (p, filename); - syntax_free (error_file_name); - error_file_name = (char *) strdup (p); - f = fopen (p, "r"); + + syntax_g_free (error_file_name); + error_file_name = g_strconcat (home_dir, EDIT_DIR PATH_SEP_STR, + filename, NULL); + f = fopen (error_file_name, "r"); if (f) return f; - strcpy (p, mc_home); - strcat (p, "/syntax/"); - strcat (p, filename); - syntax_free (error_file_name); - error_file_name = (char *) strdup (p); - return fopen (p, "r"); + + syntax_g_free (error_file_name); + error_file_name = g_strconcat (mc_home, PATH_SEP_STR "syntax" PATH_SEP_STR, + filename, NULL); + return fopen (error_file_name, "r"); } /* returns line number on error */ @@ -610,7 +613,7 @@ static int edit_read_syntax_rules (WEdit f = g; g = 0; line = save_line + 1; - syntax_free (error_file_name); + syntax_g_free (error_file_name); if (l) syntax_free (l); if (!read_one_line (&l, f)) @@ -631,7 +634,7 @@ static int edit_read_syntax_rules (WEdit g = f; f = open_include_file (args[1]); if (!f) { - syntax_free (error_file_name); + syntax_g_free (error_file_name); result = line; break; } @@ -1001,7 +1004,7 @@ void edit_load_syntax (WEdit * edit, cha message (0, _(" Load syntax file "), _(" Error in file %s on line %d "), error_file_name ? error_file_name : f, r); - syntax_free (error_file_name); + syntax_g_free (error_file_name); return; } } From proski at gnu.org Thu Nov 29 02:56:19 2001 From: proski at gnu.org (Pavel Roskin) Date: Wed, 28 Nov 2001 21:56:19 -0500 (EST) Subject: patch: MC for Win32 In-Reply-To: <01111808505700.01414@scotty> Message-ID: Hi, Franco! I'm trying to apply your patch (and applying it partially) and here are some notes. > - I took a CVS checkout from 27.Okt as a basis Strange that you are referencing gtkedit in user.h. Well, it's my guilt. Miguel asked me not to remove the gnome directories from the main branch. I should have argued that if there are any CVS problems they should be fixed in CVS, not worked around. Besides, it there are such problems, it's better if they are easy to notice (the whole directory disappears) rather than when they are subtle (one file is missing somewhere). I established an module "mc-text" on CVS but you were obviously using the complete checkout. Sorry for inconvenience :-( I'm fixing this error. The unused files have been removed from the head branch. Now it's safe again to use "cvs update -d" without risking to get GNOME-related files. > You can build mc.exe by changing to the pc subdir and run > $> make -fMakefile.MIN Please leave a space in all documentation (FAQ etc) as it's safer and less confusing. > I added the two files > > mc/pc/regex.c > mc/pc/regex.h I've committed them. We'll remove them later and a few lines in ChangeLog won't increase the size of the distribution too much :-) > mc/edit/edit.c > - Open file in binary mode on Win32 platforms. Please don't break things too much. It should apply to OS/2 as well. Then why _OS_NT and not OS2_NT? If your idea is wrong, then OS/2 porters will fix it for you, but let's not require them to do it everywhere. Besides, if you expect this fix to be used in many places, it's better to define something as "b" and use it instead of ifdefs: #ifdef OS2_NT #define FOPEN_BINARY "b" #else #define FOPEN_BINARY #endif fopen(file, "r" FOPEN_BINARY) > mc/pc/Makefile.MIN > - removed ".exe" from mingw-binary names > to make build possible on cross-compilers Does it work in Windows? > - fixed compiler and linker flags for use of glib and gettext > - fixed order of flags for linking mc.exe Fine, but please avoid double spaces - nobody needs them. > mc/pc/Makefile.PC > - added/removed files to/from build You don't update files for OS/2. It's easier that you keep things in sync, or somebody will think whether there is a reason for that difference. > mc/pc/chmod.c > - fixed includes for cross-compiler > - added gettext N_() and _() makro calls Fine. Committed. > mc/pc/config.h > - a few fixes I don't understand some of them. Perhaps backslash in includes should be elininated globally. Everything else requires explanation. > mc/pc/cons_nt.c > - changes regarding the calculation of the size of the console window on Win32 > fixes a bug with Win2k I have Win2000 now. I'll apply it when I check it. > mc/pc/dirent.h > - added comment that file seems to be no longer needed It's not just a comment. Be honest. I read your patch. If the file is not needed - remove it. > mc/pc/drive.c > - added gettext N_() and _() makro calls > - added workaround for a crash that happens > when Changing drive while panel not in DirListing mode The gettext part is fine. Please use better coding style for the new code. > mc/pc/key_nt.c > - fixed a problem with AltGr Key > - added/changed dummy functions (mouse dummys) The same comment applies. Please never put "return" to the same line as "if" since it's hard to debug. Not to mention whole functions. > mc/pc/slint_pc.c > - added comment -> DO NOT USE GETTEXT HERE Not very useful comment. There are documented means for that (POTFILES.ignore if I remember correctly). > mc/pc/util_nt.c > - fixed includes > - added gettext N_() and _() makro calls > - fixed problem with the display of free disc space > - added dummy functions Cannot you just use global.h - it's supposed to take care of includes? Please avoid C++ comments in C programs. > mc/slang/slerr.c > - fixed includes Why is this fix needed? Why is it Win32-specific? I would think that you should rather fix something else. Same applies to all slang files. > mc/src/cmd.c > - fixed includes How about global.h? Doesn't it already include sys/time.h? It it posible to add the top-level directory to the includes so that "vfs/vfs.h" works? > mc/src/command.c > - added handling of internal SET command for Win32 I don't like that you are mixing new features and pure build fixes. But how about converting the command to lowercase. Otherwise "Cd" is not supported, but "Set" is. > mc/src/ext.c > - no shellbang in temporary command file on windows Will apply. > mc/src/file.c > - fixed includes > - commented out the detection of cyclic symlinks on Win32 > this is only a Quick Fix Will apply the second part. I don't like your approach to fixing the includes. > mc/src/global.h > - fixed includes What's wrong with utime.h? Why don't you want to include it even if HAVE_UTIME_H is defined? > mc/src/main.c > - fixed includes > - director_history_add is broken on Win32 - mc crashes - > made it a dummy function on Win32 > THIS definately has to be fixed > - made init_xterm_support a dummy on Win32 - there is no xterm there > - made mc ignore Ctrl-C breaks on Win32 > - defined the gettext LOCALEDIR for Win32 > - added comment that gfree(home_dir); might no longer be needed on Win32 Please don't include local files (in quotes) before system includes. > mc/src/myslang.h > - fixed includes Again, you must be doing something wrong. > mc/src/treestore.c > - commented out > process_special_dirs (&special_dirs, CONFDIR "mc.global"); > for Win32 Why? > mc/src/user.h > - fixed includes Again: there is no such thing as gtkedit in the CVS MC. > mc/src/util.c > - fixed includes > - fixed parameters for bizp2 might be also needed for other platforms Will apply after testing. > - fixed TEMPDIR for Win32 What was wrong with it? > mc/vfs/vfs.h > - fixed includes Again, what's wrong with utime.h? If there are any problems with it it's better to use it in global.h only and move all tricks there. -- Regards, Pavel Roskin