Commit Graph

214 Commits

Author SHA1 Message Date
Andrew V. Samoilov 82f580f857 * syntax.c (get_args): Use in "args_size" argument instead of
in out "argc".  Return number of found entries.
        Adjust all callers.
2004-11-18 10:02:33 +00:00
Andrew V. Samoilov f22b5d749f * syntax.c (get_args): Use "argc" to check "args" size.
(edit_read_syntax_rules): Add new parameter "argc" (size of the
        "args" buffer) to prevent buffer overflow.
2004-11-16 19:46:46 +00:00
Andrew V. Samoilov bfee231c11 * editdraw.c (edit_status): Don't output extra characters on the
status line.
        (print_to_widget): Don't use addch() with negative offset to skip
        over excessive columns. Output only those columns that should be
        displayed on the screen.
2004-11-10 14:11:27 +00:00
Roland Illig 188b970477 * editcmd.c (edit_replace_prompt): Fixed codepage conversion bug
introduced in on 2004-09-25 by me.
2004-11-10 06:50:50 +00:00
Roland Illig 63cae58f20 * editdraw.c (edit_status): Expand the filename field in the status
line to 16 characters even if the actual filename is shorter.
2004-10-23 13:14:14 +00:00
Roland Illig 5d5237e557 * syntax.c (read_one_line): Fixed SEGV when reading syntax file
with "\r\n" line endings on Unix.
2004-10-16 13:33:21 +00:00
Andrew V. Samoilov 5d5f56d4ee * editcmd.c (regexp_error): Small text fix.
(edit_search_cmd): Likewise.
2004-10-11 05:31:29 +00:00
Roland Illig 7a505ea99d * editcmd.c (edit_ext_cmd): Revoked my last change. 2004-09-26 11:42:17 +00:00
Roland Illig d0a8da7cef * editcmd.c (edit_ext_cmd): Replaced the old version with a new
one that uses ../src/pipethrough. The new version feeds the
	currently selected block (or an empty input) into the command
	which reduces the chance of a deadlock when the command tried
	to read from stdin. It also allows the user to insert the output
	of a command that has exited with a nonzero result. Another
	feature is that it does not use temporary files.
2004-09-25 21:34:36 +00:00
Roland Illig 2a2b478f67 * syntax.c (this_try_alloc_color_pair): Added const qualifiers.
* editcmd.c (snprintf_p): Likewise. (edit_replace_prompt):
	Simplified the code.
2004-09-25 20:53:32 +00:00
Roland Illig a3c3564d4d * syntax.c (this_try_alloc_color_pair): Added const qualifiers. 2004-09-25 14:28:10 +00:00
Andrew V. Samoilov 12d24222db * edit.c (edit_clean): g_free handles NULL argument too,
no need for the comparison.
            (edit_move_backward_lots): Likewise.
        * editcmd.c (edit_set_filename): Likewise.
            (edit_replace_cmd): Likewise.
            (edit_search_cmd): Likewise.
            (edit_sort_cmd): Likewise.
            (edit_mail_dialog): Likewise.
        * syntax.c (syntax_g_free): Likewise.
            (edit_read_syntax_rules): Likewise.
2004-09-24 22:37:00 +00:00
Roland Illig 9c65d36bdd * edit.c: Replaced NULL with (char *) NULL. Likewise for 0, where
NULL was meant.
	* editcmd.c: Likewise.
	* editlock.c: Likewise.
	* editwidget.c: Likewise.
	* syntax.c: Likewise.
2004-09-24 14:57:57 +00:00
Roland Illig 283441db92 * editdraw.c (status_string): Removed unused parameter.
(edit_status): Rewrote to allow longer filenames to be displayed
	completely whenever possible.
2004-09-24 11:13:11 +00:00
Roland Illig 3c6a792d4b * edit/edit.h: renamed edit() to edit_file() to avoid GCC shadow
warnings (many variables are also called edit).
	* edit/editwidget.c: likewise.
	* src/cmd.c: renamed edit() to edit_file() to avoid GCC shadow
	warnings (many variables are also called edit).
	* src/main.c: likewise.
2004-09-19 17:46:39 +00:00
Roland Illig 6c29de339b * editcmd.c (edit_replace_prompt): Allocate the label text
dynamically instead of using catstrs. Don't handle
	ENABLE_CHARSET specially.
2004-09-19 17:23:52 +00:00
Roland Illig d5f70f2ab8 * editcmd.c (edit_replace_cmd): Added const qualifier.
* editwidget.c (edit_my_define): likewise.
2004-09-19 15:40:09 +00:00
Andrew V. Samoilov fade042845 Typos 2004-09-17 08:32:59 +00:00
Andrew V. Samoilov 32cdf184ba * editcmd.c (edit_replace_prompt) [HAVE_CHARSET]: Warning hack. 2004-09-17 03:07:37 +00:00
Andrew V. Samoilov 0758929ef1 * editwidget.c (edit_adjust_size): Fix warnings.
(edit_dialog_callback): Likewise.
        edit.c (menu_save_mode_cmd): Likewise.
2004-09-02 20:36:17 +00:00
Andrew V. Samoilov f379b30232 * editcmd.c (edit_save_as_cmd): Add hotkey to dialog.
(edit_save_confirm_cmd): Likewise. (edit_new_cmd): Likewise.
(edit_load_cmd): Likewise. (edit_block_move_cmd): Likewise.
(edit_block_delete): Likewise. (edit_ok_to_exit): Likewise.
2004-09-01 22:40:45 +00:00
Andrew V. Samoilov 83de09639c * syntax.c(this_try_alloc_color_pair): Use g_strlcpy instead
sequence strncpy(), name[len] = '\0'
(edit_read_syntax_rules):Likewise.
2004-09-01 18:37:14 +00:00
Roland Illig 263ea5c1d5 * Code cleanup: Added const qualifier for variables and
function declarations where possible. No functional changes.
2004-08-29 17:57:39 +00:00
Andrew V. Samoilov 761406cfdf * edit/editcmd.c: Fix buffer overflows in edit replace code. 2004-08-25 22:12:02 +00:00
Roland Illig c12aeadadb Added missing ChangeLog items from 2004-08-16. 2004-08-24 11:24:43 +00:00
Andrew V. Samoilov bb8bf1756e * syntax.c (edit_read_syntax_rules): Dynamically allocate
more space for contexts and for words in context.
2004-08-22 20:47:56 +00:00
Pavel Roskin 603e2af580 * editcmddef.h: Split CK_No_Command into CK_Insert_Char and
CK_Ignore_Key.
* editkeys.c (emacs_key_map): Ignore Ctrl-g.  Requested by
Paul Seelig <pseelig@uni-mainz.de>
(edit_translate_key): Implement CK_Ignore_Key.
2004-02-04 23:09:22 +00:00
Pavel Roskin 90ae5d102d * edit.c (edit_execute_key_command): Return void, the result is
never used.
(edit_execute_cmd): Likewise.
2004-02-04 22:27:58 +00:00
Dmitry Alexeyev c459caead1 * syntax.c (edit_read_syntax_rules): Fix crash if syntax file
has more than 1024 keywords.
2003-12-24 07:38:49 +00:00
Pavel Roskin a7c0bbac62 * editcmd.c: Use input_expand_dialog() instead of input_dialog()
for loading and saving files.
2003-11-27 10:23:50 +00:00
Pavel Roskin f51e86a184 * editcmd.c (pipe_mail): Eliminate g_strdup_printf().
(edit_complete_word_cmd): Fix possible buffer overflow.
2003-11-24 20:27:34 +00:00
Pavel Roskin 4bc92accff * editcmd.c (edit_mail_dialog): Trivial clean-up. 2003-11-03 18:59:50 +00:00
Pavel Roskin ad84a71c64 * edit-widget.h (struct WEdit): Add GTree *defines field.
* syntax.c: Use edit->defines instead of static defines.
2003-10-23 23:23:46 +00:00
Pavel Roskin f426c570a6 * syntax.c (compare_word_to_right): More checks for braces and
brackets.
2003-10-16 20:31:06 +00:00
Pavel Roskin 7f8dfa977d * syntax.c (compare_word_to_right): Fix recent breakage - rules
ending with wildcard (e.g. "$+") won't match.
2003-10-16 20:16:38 +00:00
Pavel Roskin e90a7540a2 * edit.h: Make static all functions and variables that don't
need to be global.  Remove unused functions.  Adjust all
dependencies.
2003-10-14 21:48:40 +00:00
Pavel Roskin fce42c9316 * syntax.c: Give names to numeric tokens. 2003-09-22 23:04:48 +00:00
Pavel Roskin daab7bd737 * syntax.c (compare_word_to_right): Add checks that we don't go
beyond text length for certain invalid rules.
Reported by Juan C. Olivares <juancri@TAGnet.org>
2003-09-22 22:30:48 +00:00
Pavel Roskin e0f9b7ab83 * editcmd.c (edit_raw_key_query): Use straight widget order.
(edit_completion_dialog): Likewise.
* editwidget.c (edit): Likewise.
2003-09-12 21:30:29 +00:00
Pavel Roskin 38265d418d * edit.h: Get rid of WIDGET_COMMAND, update all dependencies. 2003-09-07 19:08:07 +00:00
Pavel Roskin cf9acd036e * edit-widget.h: Resurrect "dir" field in WEdit to store
directory for relative filenames.

* edit.c (edit_clean): Release edit->dir.

* editcmd.c (edit_save_file): Use absolute filename.
Temporarily disable safe save and backups on remote VFS because
it doesn't work - again.
2003-07-31 16:38:07 +00:00
Pavel Roskin 58572c60da * edit.c (edit_execute_cmd): Enable user menu in mcedit. 2003-07-25 18:52:28 +00:00
Pavel Roskin dadbdd25e9 * editcmd.c (edit_quit_cmd): Rename to ...
(edit_ok_to_exit): ... this.  Don't stop dialog - this function
is called by the dialog code.
* editwidget.c (edit_dialog_callback): Process DLG_VALIDATE
event.  Don't exit it the user wants to continue editing.
* edit.c (edit_execute_cmd): Close the dialog - it will ask user
if necessary.
2003-07-21 03:54:47 +00:00
Pavel Roskin 9bc8df86ad * editcmd.c (edit_quit_cmd): Don't save this command in the undo
stack.  Don't force any refresh.  Don't delete unsaved files, do
it ...
* edit.c (edit_clean): ... here.  This ensures that unsaved
files from the mcedit command line are erased on Ctrl-n.
2003-07-20 23:24:25 +00:00
Pavel Roskin 0633d91f60 * editwidget.c (edit): Remove unused variable "framed". 2003-07-20 22:15:28 +00:00
Pavel Roskin 4b8f0b02b2 * edit.c (edit_clean): Remove stale lock if any. 2003-07-09 00:21:09 +00:00
Pavel Roskin 5ff5f8e9d1 * edit-widget.h: Add new field loading_done.
* edit.c (edit_init): Set loading_done.
(edit_insert): Don't call edit_modification() before the file is
completely loaded.
2003-07-09 00:18:11 +00:00
Pavel Roskin 59593d0e1b * edit-widget.h: Eliminate unused explicit_syntax field. 2003-07-08 23:58:36 +00:00
Pavel Roskin 729a855b29 * edit-widget.h: Stop misusing "unsigned char" for boolean.
Eliminate have_frame - it's unused.  Adjust all dependencies.
2003-07-08 23:46:01 +00:00
Pavel Roskin 6b63507463 * editkeys.c: Leave only distinct entries in cooledit_key_map
and emacs_key_map.  Move the rest to common_key_map.
2003-06-14 05:02:33 +00:00