Commit Graph

326 Commits

Author SHA1 Message Date
Pavel Roskin 8148b4973c * edit.c (edit_reload): Don't initialize edit->macro_i, because
edit_init() takes care of it.
* editwidget.c (edit): Likewise.
2002-12-16 01:27:44 +00:00
Pavel Roskin 2048c47dfb Comment change. 2002-12-15 22:58:33 +00:00
Pavel Roskin aaf569bd48 * edit.h: Don't inclide malloc.h. Use g_malloc() and g_free()
instead.  Adjust all dependencies.
2002-12-15 18:55:53 +00:00
Pavel Roskin 77bd4c7f55 * edit.c (edit_load_file): Merge edit_open_file(). Disable fast
loading on non-local VFS because the file size can be wrong.
(init_dynamic_edit_buffers): Split into edit_init_buffers() and
edit_load_file_fast().
2002-12-15 09:47:25 +00:00
Pavel Roskin 433726e56b * (edit_init): Move file loading to ...
(edit_load_file): ... a separate function.
2002-12-15 08:07:02 +00:00
Pavel Roskin 6716e7ecff * edit.c (init_dynamic_edit_buffers): Remove unused code to
support loading text from buffer.
2002-12-15 06:53:52 +00:00
Pavel Roskin ceb3e9eb60 Comment fixes. 2002-12-15 02:54:00 +00:00
Pavel Roskin ca658f44a6 * editcmd.c (edit_split_filename): Rename to edit_set_filename,
use g_malloc() and g_free() on edit->filename.
2002-12-15 02:40:38 +00:00
Andrew V. Samoilov ce29907cce Fix typo 2002-12-10 08:27:03 +00:00
Pavel Roskin 46958e5630 s/Error trying to/Cannot/ 2002-12-08 09:27:18 +00:00
Pavel Roskin 581cf41929 * edit.c (edit_open_file): Remove "text" and "text_size"
arguments.  Adjust all callers.
2002-12-08 09:10:38 +00:00
Pavel Roskin 78155218a6 * edit.c (edit_move_to_column): Remove, use
edit_move_to_prev_col() instead.
2002-12-08 08:18:57 +00:00
Pavel Roskin c935eaa6c2 * edit.c: Commit the rest of the position saving code.
(edit_load_position): New function, load position.
(edit_save_position): New function, save position.
(edit_init): Take new argument "line".  If it's 0, load position
from .mc/filepos.
(edit_clean): Save file position to .mc/filepos even if the file
is not being saved.
* editwidget.c (edit): Don't set the initial line, pass it to
edit_init().
2002-12-08 07:47:59 +00:00
Pavel Roskin 2f2864e500 * syntax.c (edit_load_syntax): Reuse more informative error
message.
2002-12-08 01:57:35 +00:00
Pavel Roskin c3cdbeb001 * edit.c (check_file_access): Use O_EXCL when opening new files.
Don't allow editing stale symlinks.
Reported by Max Derzhak <max@linux.zp.ua>
2002-12-08 00:55:03 +00:00
Pavel Roskin b64955fbbd s/Failed trying to/Cannot/ 2002-12-08 00:40:11 +00:00
Pavel Roskin f2ccab3adc * edit-widget.h: Remove "from_here" and "to_here".
* edit.c (edit_purge_widget): New function - clean struct WEdit
except the Widget part.
2002-12-06 04:49:58 +00:00
Pavel Roskin dceb3b50d4 * editcmd.c: Include dialog.h.
Reported by Frédéric L. W. Meunier <lists@pervalidus.net>
2002-12-04 07:20:19 +00:00
Pavel Roskin 2548ea0e7c Use normal capitalization in English text in the editor menu. 2002-12-01 06:33:58 +00:00
Pavel Roskin 5c0e8be6ca "Privatize" font-related defines. 2002-11-30 19:59:02 +00:00
Pavel Roskin dd7f5798fa * edit.h: Remove "dir" field in WEdit - it's always an empty
string.  Adjust all dependencies.
2002-11-30 19:50:51 +00:00
Pavel Roskin 9a4513aceb * editcmd.c (edit_get_save_file): Remove first argument, it's
unused.
(edit_get_save_file): Likewise.
2002-11-30 18:49:20 +00:00
Pavel Roskin 75fbf0b2f5 * syntax.c: Make structures key_word, context_rule and
_syntax_marker opaque.
2002-11-30 18:07:42 +00:00
Pavel Roskin 41fbb5099f * edit.c: Use g_malloc() and g_free() on buffers1 and buffers2.
Eliminate CMalloc.
(edit_get_buffer_as_text): Remove, it's unused.
2002-11-30 17:53:12 +00:00
Pavel Roskin 29f1543919 * editcmd.c (edit_set_search_parameters): Use g_malloc().
(edit_complete_word_cmd): Use g_free().
2002-11-30 17:41:07 +00:00
Pavel Roskin b628d515c0 * edit.h: Don't define HAVE_SYNTAXH.
* syntax.c: Syntax highlighting is no more optional.
(edit_check_spelling): Remove.
2002-11-30 02:29:43 +00:00
Pavel Roskin c63d61600a * editoptions.c (edit_options_dialog): Add "Save file position"
option, make "Syntax highlighting" unconditional.
2002-11-30 00:41:47 +00:00
Pavel Roskin 527cb0c64c * edit.c: First part of the position saving code.
(edit_move_to_column): New function.
2002-11-30 00:35:07 +00:00
Andrew V. Samoilov 085f43fc8d * editoptions.c (edit_options_dialog): Use g_free() to release
variables allocated in quick_dialog().
2002-11-29 08:28:51 +00:00
Pavel Roskin 18de4488e3 * edit-widget.h: Move typedef WEdit and file names ...
* edit.h: ... here.  Don't include edit-widget.h.  Adjust all
dependencies.
2002-11-29 03:01:06 +00:00
Andrew V. Samoilov 486038e9b4 * editoptions.c (edit_options_dialog): Clean up and use g_snprintf()
instead of sprintf().
2002-11-23 17:26:55 +00:00
Pavel Roskin 5cb2ef30f3 Fix duplicate declarations. 2002-11-15 06:38:55 +00:00
Pavel Roskin 9e1f47ddb7 Remove disabled entries - they give a bad example of
using pseudo-English (a.k.a. Engrish) in the menu.
2002-11-14 22:51:37 +00:00
Pavel Roskin 7969f851bb * edit.h: Decentralize includes. 2002-11-14 19:38:26 +00:00
Pavel Roskin 389ed511de * editmenu.c (edit_user_menu_cmd): Move to ../src/cmd.c. 2002-11-14 06:25:46 +00:00
Pavel Roskin c6e56452ea * exit.c (edit_delete_line): Don't remove and restore the
preceding newline.  Don't treat binary zero as newline.
From Dmitry Semyonov <Dmitry.Semyonov@oktet.ru>
2002-11-14 05:17:56 +00:00
Pavel Roskin e741be7a5d * *.c: Fix all global functions without declarations - declare,
make static or remove.
2002-11-13 04:32:00 +00:00
Pavel Roskin 66f451aac7 * dlg.c (send_message_to): Remove, use send_message() instead.
(send_message): Make inline, remove Dlg_head argument.  Change
all callers.
2002-11-13 02:56:40 +00:00
Pavel Roskin bc70c8cc1e * dlg.h: Remove Dlg_head argument from callback_fn - it's
excessive and can be trivially derived from the widget.
(default_proc): Remove Dlg_head argument.  Change all callers.
2002-11-13 02:27:35 +00:00
Pavel Roskin 47ab84d950 * syntax.c (syntax_change_callback): Remove, it's unused.
(edit_set_syntax_change_callback): Likewise.
2002-11-13 02:13:37 +00:00
Pavel Roskin 2b9d151923 * edit.c (edit_execute_cmd): Fool gcc to prevent Y2K warning. 2002-11-13 02:05:01 +00:00
Pavel Roskin 0106eebda6 * editwidget.c (edit_adjust_size): Use find_buttonbar(). 2002-11-12 23:35:25 +00:00
Pavel Roskin b0481b41bf * menu.h: Remove "*" from the definition of the type "Menu"
for consistency with other types.  Change all dependencies.
(menubar_event): Make static.
2002-11-12 21:01:50 +00:00
Pavel Roskin af883aaecf Fixes in English messages. 2002-11-11 17:27:13 +00:00
Pavel Roskin 4061502e82 * editcmd.c: Warning fix for compilers that don't understand the
"const" keyword and variable size arrays.
2002-11-11 08:06:01 +00:00
Andrew V. Samoilov 2a63d42f09 s/varaibles/variables/
s/declaratrions/declarations/
s/notning/nothing/
s/writting/writing/
s/occurences/occurrences/
2002-11-07 06:52:25 +00:00
Pavel Roskin c626f5fdcc * editcmd.c (edit_save_file): Restore ownership before access
mode, not after.  Otherwise suid bit is lost.
Reported by Nerijus Baliunas <nerijus@users.sourceforge.net>
2002-11-06 18:09:40 +00:00
Pavel Roskin b2fd313167 * edit.c: Include charset.h unconditionally, use new conversion
functions that don't require ifdefs.
* edit_key_translator.c: Likewise.
* editcmd.c: Likewise.
* editdraw.c: Likewise.
2002-10-30 23:56:49 +00:00
Pavel Roskin a84b0fc9cd Fix some of the most ugly abuses of mixed caps in English texts,
especially in button captions.
2002-10-21 22:26:39 +00:00
Pavel Roskin 31f1ddd081 Reuse message " Insert File ". 2002-10-21 05:31:47 +00:00
Pavel Roskin b3614cbd31 Reuse text " Delete macro " with different capitalization. 2002-10-21 05:26:55 +00:00
Pavel Roskin 370797a3e2 Use "Cancel" and "Continue" without spaces. 2002-10-21 05:03:01 +00:00
Pavel Roskin de81dccac6 Reuse " Save macro " message. 2002-10-21 04:31:14 +00:00
Pavel Roskin d3f0a2f61b Remove spaces around "Error" and "Warning" together with their translations.
Also remove spaces from "Quit" and "Search", but leave alone the
translations, that already have them without spaces.
2002-10-21 04:13:49 +00:00
Pavel Roskin 63983758e0 * edit-widget.h: Add new field macro_depth to control depth of
macro recursion.
* edit.c (edit_execute_macro): Make static.  Increment
macro_depth on entry, decrement on exit, don't allow it to be
too large.
2002-10-21 02:06:03 +00:00
Pavel Roskin 7f072959a4 * wordproc.c (line_start): Remove incorrect optimization abusing
static varaibles.  Internal formatting should be usable now.
2002-10-20 17:08:11 +00:00
Pavel Roskin eec9e4b850 * wordproc.c (begin_paragraph): Fix the same off-by-one error as
in end_paragraph() - it affects formatting of the paragraph
after the first line in the file it that line starts with a dot.
Remove unused argument.
2002-10-18 16:43:03 +00:00
Pavel Roskin 387cf0327b * wordproc.c (end_paragraph): The last line of the file wasn't
tested for being blank, which resulted in the last newline
becoming a space after formatting.
2002-10-18 05:25:01 +00:00
Pavel Roskin 2b5fec4594 * editoptions.c (edit_options_dialog): Don't allow
option_tab_spacing to be 0.  Reset invalid values to 8.
Reported by Ury N. Stankevich <ury@bofh.homeunix.org>
2002-10-17 05:43:57 +00:00
Pavel Roskin 346e628955 * wordproc.c (format_paragraph): If formatting was successful,
scroll to the left to show the formatted paragraph.
2002-10-08 05:03:45 +00:00
Pavel Roskin b79fe53f97 Remove unnecessary and incorrect declaration of edit_cursor_to_bol(). 2002-10-08 04:50:20 +00:00
Pavel Roskin 540ffe0db3 * editdraw.c (print_to_widget): Eliminate use of floating point.
Change all callers.
2002-10-06 21:08:20 +00:00
Andrew V. Samoilov b8d41cad3b * (edit_insert_column_of_text): Fix infinite loop if
block of text is copied past the end of the buffer.
By Paul Sheer <psheer@icon.co.za>.

(stacked): Don't initialize static arrays by zeros.
2002-10-02 15:44:35 +00:00
Pavel Roskin da7e82d253 Global removal of RCS Id: flags. 2002-09-26 23:13:45 +00:00
Andrew V. Samoilov 790b85b555 * edit.h (struct key_word): Remove time field.
* syntax.c: Remove MAD support.
2002-09-26 12:23:13 +00:00
Pavel Roskin e7e6552a03 * editwidget.c (edit): Make edit_dlg local variable. 2002-09-24 15:10:47 +00:00
Pavel Roskin 91f4a75562 * editmenu.c (edit_drop_menu_cmd): Don't use edit_dlg variable. 2002-09-24 15:04:22 +00:00
Pavel Roskin 2e3fc9234b * edit.c: Remove all references to CR_LF_TRANSLATION.
* editcmd.c: Likewise.
2002-09-24 04:35:44 +00:00
Pavel Roskin 996a847666 * editwidget.c (edit): Install handler for DLG_RESIZE. 2002-09-24 03:57:36 +00:00
Pavel Roskin 2571416650 * editwidget.c (edit): Set edit_dlg to NULL after it's
destroyed.
2002-09-23 23:42:44 +00:00
Pavel Roskin 50c15654ef * edit.h: Move style definitions ...
* editdraw.c: ... here.  Multiply them by 256.  Remove unused
styles.
(print_to_widget): Don't divide style by 256.  Simplify logic
since we only have 4 styles now.
2002-09-23 23:05:15 +00:00
Pavel Roskin 6d1beed458 * edit.c (edit_move_forward3): Use caret notation for code 127
and below code 32.
* editdraw.c (edit_draw_this_line): Likewise.  Print '.' for
other non-printable characters and remove this code from ...
(print_to_widget): ... here.
2002-09-23 22:32:47 +00:00
Pavel Roskin 07de958369 * edit.c (edit_move_forward3): Show 'r' as ^M.
* editdraw.c (edit_draw_this_line): Likewise.  Use MOD_ABNORMAL
attribute.
From Alexander Varakin <avarakin00@hotmail.com>
2002-09-23 07:13:11 +00:00
Pavel Roskin 3d8a56ee9c * edit.h: Remove all references to O_TEXT, USE_O_TEXT and
MY_O_TEXT.
2002-09-23 07:00:30 +00:00
Pavel Roskin e49a220a30 * edit.c: Use O_BINARY when opening files.
* editcmd.c: Likewise.
From Alexander Varakin <avarakin00@hotmail.com>
2002-09-23 06:54:50 +00:00
Pavel Roskin 966511399b Move fcntl.h inclusion to global.h. 2002-09-23 06:45:32 +00:00
Pavel Roskin fb418291eb * editwidget.c (edit_event): Add support for mouse wheel events.
* edit.h: Add missing declarations for edit_move_up() and
edit_move_down().
2002-09-21 00:16:04 +00:00
Andrew V. Samoilov bb947f855e * edit.c: Don't initialize static selection and selection_history. 2002-09-20 15:42:25 +00:00
Andrew V. Samoilov 9f80054302 * editdraw.c (status_string): Remove font_width argument.
(edit_status): Fix calculation to use last column in the status string.
2002-09-20 15:15:43 +00:00
Pavel Roskin b5265f8da5 * edit.c (edit_filters): Use gzip, not compress for *.Z files
for consistency with other parts of the code (viewer, mc.ext).
2002-09-04 18:57:14 +00:00
Pavel Roskin 31e34e93b8 * editcmd.c: Recheck and fix all calls to create_dlg().
* editwidget.c: Likewise.
2002-09-03 19:37:40 +00:00
Pavel Roskin 09df85b9b7 Reuse other translated strings. 2002-09-03 16:55:05 +00:00
Pavel Roskin d9c6403250 * wtools.h (QuickDialog): Eliminate the "class" field - it's not
used and it can clash with C++ code.  Adjust all dependencies.
2002-09-03 08:00:02 +00:00
Pavel Roskin 2d93d274b5 * editcmd.c (edit_raw_key_query): Eliminate
x_set_dialog_title().
2002-09-02 19:53:36 +00:00
Pavel Roskin 9a5bacf175 * editcmd.c (edit_block_process_cmd): Restore third argument
(but make it /dev/null) for compatibility with old scripts.
Reported by Andrew V. Samoilov <sav@bcs.zp.ua>
2002-09-01 23:20:37 +00:00
Pavel Roskin d02a8d6473 * editwidget.c (edit): Avoid passing an uninitialized color
array to create_dlg() - pass NULL instead.
2002-08-31 04:33:40 +00:00
Andrew V. Samoilov 63d111db28 * editcmd.c (edit_printf): Use g_vsnprintf() instead of sprintf(). 2002-08-27 17:01:23 +00:00
Pavel Roskin b6862a8c26 Fix some not quite English strings in edit_block_process_cmd(). 2002-08-25 19:21:30 +00:00
Pavel Roskin 221c35266c * edit-widget.h: Eliminate ERROR_FILE.
* edit.c: Remove all references to ERROR_FILE.
* editcmd.c (edit_block_process_cmd): Revert to using catstrs(),
those strings are freed now.  Use system(), not execute() to
execute commands.  Use open_error_pipe() and close_error_pipe()
to keep track of errors.
2002-08-24 17:22:15 +00:00
Pavel Roskin 74d224e1b2 * editcmd.c: Clean up global variables in the completion code. 2002-08-22 22:15:39 +00:00
Pavel Roskin 6071fea76d * editwidget.c: Use new dialog flags.
* editcmd.c: Likewise.
(edit_completion_dialog): Set DLG_COMPACT for the dialog.
2002-08-22 15:38:27 +00:00
Pavel Roskin 089a1ae9e5 * editcmd.c (compl_callback): Use common_dialog_repaint(). 2002-08-22 06:10:41 +00:00
Pavel Roskin 8275c2f5fd * editcmd.c (raw_callback): Use standard common_dialog_repaint()
to handle DLG_DRAW.
2002-08-22 05:58:30 +00:00
Pavel Roskin 231f67342e * editwidget.c (edit): Make edit_bar a local variable. 2002-08-21 22:54:27 +00:00
Pavel Roskin 9e36fa257d * global.h: Move include for rx.h and eregex.h here. 2002-08-21 07:20:39 +00:00
Pavel Roskin 4756fbf271 * editcmd.c (freestrs): Set freed strings to NULL.
(catstrs): Use g_malloc() and g_free().
2002-08-20 23:57:34 +00:00
Pavel Roskin 42f28932fc * editcmd.c (freestrs): New function to clean temporary strings.
* edit.c (edit_clean): Call freestrs().
2002-08-20 23:18:36 +00:00
Pavel Roskin 37318c2b78 * editmenu.c: Use new create_menu() interface. 2002-08-20 21:31:23 +00:00
Pavel Roskin 3a93326ce7 * editoptions.c: Make some variables static.
* edit.h: Take extern declaratrions from all C files.
2002-08-19 01:23:24 +00:00
Pavel Roskin 5dbb74eca2 * editcmd.c (edit_block_process_cmd): Plug memory leak.
Simplify logic, reformat.
2002-08-19 00:33:08 +00:00
Pavel Roskin 21cc1c5e28 * edit.c (edit_push_action): Fix access to uninitialized memory.
Found by Valgrind.
2002-08-02 16:44:04 +00:00
Pavel Roskin d6a8671055 * syntax.c: Remove all references to MAD. 2002-08-01 20:44:24 +00:00
Pavel Roskin e692d7865c * edit.h: Don't include mad.h. 2002-08-01 19:42:45 +00:00
Andrew V. Samoilov bfe29a4ac2 * edit.h: Really remove open, close, write, read and mkdir definitions. 2002-07-30 18:39:04 +00:00
Andrew V. Samoilov f7de38f345 * edit.h (edit_get_load_file): Mark message for translation.
(edit_get_save_file): Ditto.
2002-07-29 17:09:02 +00:00
Pavel Roskin 2e17e22122 * syntax.c (apply_rules_going_right): Recheck keyword rules when
a keyword is found on the left border of a context.
2002-07-20 09:12:55 +00:00
Pavel Roskin 72a5fc5cc1 * syntax.c (edit_get_syntax_color): Return colorpair index, not
attribute, when syntax highlighting is disabled.  Handle black
and white mode separately.
2002-07-14 22:39:07 +00:00
Pavel Roskin 3c437c273d * syntax.c (edit_load_syntax): Do nothing in black and white
mode.
2002-07-14 22:19:49 +00:00
Pavel Roskin 75666df0fe * edit.h [!HAVE_SLANG]: Enable syntax highlighting.
* editdraw.c [!HAVE_SLANG]: Respect attributes for color pairs
by using MY_COLOR_PAIR macro.
2002-07-14 21:43:53 +00:00
Pavel Roskin a23618b2ef * edit.h (struct key_word): Remove unused "bg" field, rename
"fg" to	"color", since it keeps all color information.
* syntax.c (edit_get_syntax_color): Replace "fg" and "bg"
arguments with a single argument "color".
Adjust all dependencies.
2002-07-14 17:56:47 +00:00
Pavel Roskin bb989f677a * editdraw.c (edit_draw_this_line): Fix setting MOD_ABNORMAL
attribute.
(print_to_widget): Fix displaying non-printable characters with
ncurses.  Set color for every character even if syntax
highlighting is not compiled - it's needed to reset color after
non-printable characters.
2002-07-14 07:49:24 +00:00
Pavel Roskin 4655fbbb6b * editdraw.c (edit_status): Use EDITOR_NORMAL_COLOR instead of
NORMAL_COLOR.
* syntax.c (edit_get_syntax_color) [!HAVE_SYNTAXH]: Likewise.
2002-07-14 06:17:02 +00:00
Pavel Roskin 2ce74d23e1 * edit.c (check_file_access): Return 1 on all errors, document
this behavior.  Set edit->delete_file to 1 for newly created
files.
(edit_open_file): Don't set edit->delete_file, it's now done in
check_file_access().
Reported by Saso <saso@bojler.dhs.org>
2002-06-24 23:41:59 +00:00
Andrew V. Samoilov a1efabf66b Revert two casts back to fix calculation 2002-05-13 17:28:28 +00:00
Andrew V. Samoilov 17a0c13186 s/declaration/definitions/ in the last but one entry 2002-05-13 17:15:14 +00:00
Andrew V. Samoilov 16b73c1f39 * editcmd.c (edit_save_file): Call mc_chown () and mc_chmod ()
before mc_open () to prevent hangs over ftpfs.
2002-05-13 17:12:45 +00:00
Andrew V. Samoilov 0b08e1b69f * edit.h: Remove open, close, write, read and mkdir declaration.
* edit.c: Use mc_open, mc_close, mc_write, mc_read, mc_rename,
mc_chmod and mc_chown. Don't cast (char *) to (unsigned long)
in pointer arithmetics.
* editcmd.c: Likewise.
2002-05-13 16:53:51 +00:00
Andrew V. Samoilov 47f1ce66af * syntax.c (edit_read_syntax_file): Use system wide Syntax
Highlighting definitions' file if there is no users one.
2002-03-25 07:52:53 +00:00
Pavel Roskin 351a118d20 * edit.h: Use eregex.h, not regex.h.
From Alexander Varakin <avarakin00@hotmail.com>
2002-03-18 21:09:50 +00:00
Andrew V. Samoilov 80fb518808 * editcmd.c (edit_replace_cmd): Eliminate fin_string
and use message() to fix possible buffer overflow.
(edit_search_cmd): Likewise.
2002-02-27 15:40:22 +00:00
Andrew V. Samoilov fc3ef44f3b * syntax.c (convert): Fix buffer overflow for ".*\" cases. 2002-02-18 14:48:36 +00:00
Pavel Roskin 817602f8af * editdraw.c (edit_scroll_screen_over_cursor): Do nothing if the
edit widget has zero width or height.
2002-01-23 00:12:17 +00:00
Pavel Roskin 3d0de08b32 * edit.c: Rename DELETE to DELCHAR to avoid macro redefinition
on Win32.
* edit.h: Likewise.
2002-01-22 00:49:33 +00:00
Pavel Roskin 7ed785e3cc * edit.c: Add support for CK_Complete_Word event.
* editcmddef.h: Likewise.
* edit_key_translator.c (cooledit_key_map): Bind Alt-Tab to
CK_Complete_Word.
(emacs_key_map): Likewise.
* editcmd.c: Implement word completion.
2002-01-21 17:49:57 +00:00
Pavel Roskin eb28e580d9 * editmenu.c (CmdMenuEmacs): Add mail command without shortcut.
Users of emacs keys should be able to send mail too.
2002-01-21 08:26:23 +00:00
Andrew V. Samoilov 1e5b1bfde1 * edit-widget.h: Use PATH_SEP_STR. 2002-01-15 01:43:50 +00:00
Andrew V. Samoilov e41f4c01e4 (edit_read_syntax_rules): Eliminate c->single_char.
It's only written but never read.

* edit.h (struct context_rule): Comment out single_char field.
It is written once but never read.
2002-01-15 01:41:18 +00:00
Andrew V. Samoilov 3eea969c3b * syntax.c (syntax_g_free): New macro 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 macro.
(open_include_file): Eliminate p array. Use glib function to
construct error_file_name. Use PATH_SEP instead of '/';
(edit_read_syntax_file): Use PATH_SEP_STR.
(edit_load_syntax): Use syntax_g_free to release error_file_name.
(edit_read_syntax_rules): Likewise.
2002-01-15 01:32:59 +00:00
Andrew V. Samoilov 3f55f6bf2f * editcmd.c (sprintf_p): Don't cast (char *) to (unsigned long). 2001-12-22 17:34:51 +00:00
Andrew V. Samoilov c69a25c5eb * editcmd.c (edit_goto_cmd): Use g_free to release f.
(edit_save_file): Use PATH_SEP instead of '/'.
Undefine "close" before closing file created by mc_mkstemps.
Define close to mc_close after it - temporary fix.
2001-12-22 17:29:46 +00:00
Andrew V. Samoilov bd3bdac638 * syntax.c (read_one_line): Undo last patch - errno is a
function on some systems.  Check ferror() status before
everithing else if fgetc returns EOF.
Accept last line without trailing newline.

(compare_word_to_right): Don't cast p and q to unsigned long.
(apply_rules_going_right): Likewise.
2001-12-22 16:00:30 +00:00
Pavel Roskin eba0c6e703 * edit.c (user_menu): Don't move the cursor before and after
inserting the block.
Reported by Matthias Urban <murban@cs.uni-magdeburg.de>
2001-12-22 00:32:20 +00:00
Pavel Roskin 6c821c8ad5 * syntax.c (read_one_line): Clear errno before using it. Don't
use the result of fgetc() if errno is EINTR.
2001-12-21 23:33:18 +00:00
Pavel Roskin 27d176979b s/crush/crash/ and other minor things. 2001-12-03 23:38:11 +00:00
Andrew V. Samoilov a34c2786cb * 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.
2001-11-28 12:40:18 +00:00
Andrew V. Samoilov 23bdcf3d1e * editdraw.c (edit_render): Eliminate f. It's only written
but never read.
2001-11-28 12:31:48 +00:00
Andrew V. Samoilov d9a88088d1 * editmenu.c (edit_wrap_cmd): Use g_free() on the result
of input_dialog().
2001-11-27 12:38:30 +00:00
Andrew V. Samoilov 08a8461efa * editcmd.c (edit_save_file): Use g_free() on the result of
mc_mkstemps().
2001-11-22 10:56:09 +00:00
Andrew V. Samoilov 29dd051ce8 * edit.c (edit_renew): Release dir after use.
* editcmd.c (edit_replace_dialog): Eliminate tsearch_text,
treplace_text and targ_order.
(edit_replace_cmd): edit_replace_dialog gives g_malloced
strings, so g_strdup/g_free have to be used.  Accept only
positive pattern number in Scanf search and replace.
(edit_save_file): Enable safe save and backups on remote VFS.
2001-11-19 07:31:32 +00:00
Andrew V. Samoilov b6b8cd0433 * edit_key_translator.c (cooledit_key_map):
Add C-k, CK_Delete_To_Line_End.

* edit.c (user_menu): Don't assign block_file twice.
2001-11-16 07:23:36 +00:00
Andrew V. Samoilov 51b1972843 * edit.c (edit_reload): destroy_dlg g_free()s widgets, so
g_malloc/g_free have to be used.
	(edit_init): Ditto.  Eliminate st.
2001-11-07 08:43:15 +00:00
Andrew V. Samoilov d3579ce57b (edit_load_cmd): input_dialog returns g_malloc(ed) string,
so g_free has to be used.
(edit_save_block_cmd): Likewise.
(edit_insert_file_cmd): Likewise.
(edit_sort_cmd): Likewise.
(edit_save_as_cmd): Likewise. Memory leak fixed.
2001-11-06 08:52:13 +00:00
Andrew V. Samoilov 301c38b445 (edit_load_cmd): input_dialog returns g_malloc(ed) string,
so g_free has to be used.
(edit_save_block_cmd): Likewise.
(edit_insert_file_cmd): Likewise.
(edit_sort_cmd): Likewise.
(edit_save_as_cmd): Likewise. Memory leak fixed.
2001-11-05 13:24:18 +00:00
Andrew V. Samoilov 328cbcb954 * edit.h (edit_execute_cmd): Declare it here.
* edit.c: Remove edit_execute_cmd declaration.
(edit_execute_cmd): Use edit_print_string instead of edit_printf.

* editcmd.c:  Remove edit_execute_cmd declaration.
(edit_search_dialog): Eliminate tsearch_text.
(edit_search_cmd): edit_search_dialog gives g_malloc()ed exp.
Use g_strdup/g_free instead of strdup/free.
(edit_mail_dialog): quick_dialog use g_strdup, so g_free
must be used.

* bookmark.c (book_mark_clear): Eliminate rend.
It's only written but never read.
(book_mark_flush): Likewise.
(book_mark_inc): Likewise.
(book_mark_dec): Likewise.
2001-11-05 09:23:05 +00:00
Pavel Roskin 3b32c84134 Add .deps 2001-10-29 06:27:31 +00:00
Pavel Roskin edf0504087 * edit.c (user_menu): If the error file is missing, treat it as
success.  Truncate block file unconditionally.
2001-10-23 05:40:13 +00:00
Pavel Roskin b1c57095b2 * edit.c: Stop using _EDIT_C definition. Move variable
declarations from edit.h, make static or eliminate if possible.
Report errors immediately.
* edit.h: Likewise.
* editwidget.c (edit): Don't report errors from edit_init(),
they are reported in place.
2001-10-23 01:46:53 +00:00
Pavel Roskin 943bae02ad * editcmd.c (sprintf_p): Declare with the printf attribute.
Make static.
2001-10-20 07:20:30 +00:00
Pavel Roskin 399d996408 * edit.h: Declare edit_printf() with the printf attribute. 2001-10-20 07:16:50 +00:00
Pavel Roskin c932c4610a * edit.c (check_file_access): Only allow to edit regular files.
Use stat() before open() to prevent hangs on pipes, use fstat()
afterwards if stat() was unsuccessful.
2001-10-18 09:35:22 +00:00