1
1

* view.c (view_init): Constify "_command" argument.

(view): Likewise.
(do_view_init): Likewise.
(init_growing_view): Constify "name" and "filename" args.
* view.h: Fix declarations and comment.
Этот коммит содержится в:
Pavel Roskin 2003-09-09 04:54:59 +00:00
родитель 35931b119e
Коммит 3058921b75
3 изменённых файлов: 15 добавлений и 9 удалений

Просмотреть файл

@ -1,5 +1,11 @@
2003-09-09 Andrew V. Samoilov <sav@bcs.zp.ua> 2003-09-09 Andrew V. Samoilov <sav@bcs.zp.ua>
* view.c (view_init): Constify "_command" argument.
(view): Likewise.
(do_view_init): Likewise.
(init_growing_view): Constify "name" and "filename" args.
* view.h: Fix declarations and comment.
* user.c (execute_menu_command: Fix rare segmentation violation * user.c (execute_menu_command: Fix rare segmentation violation
if last line in menu file contain space(s) only and no trailing if last line in menu file contain space(s) only and no trailing
newline. newline.

Просмотреть файл

@ -516,7 +516,7 @@ set_view_init_error (WView *view, const char *msg)
/* return values: NULL for success, else points to error message */ /* return values: NULL for success, else points to error message */
static char * static char *
init_growing_view (WView *view, char *name, char *filename) init_growing_view (WView *view, const char *name, const char *filename)
{ {
char *err_msg = NULL; char *err_msg = NULL;
@ -605,7 +605,7 @@ load_view_file (WView *view, int fd)
/* Return zero on success, -1 on failure */ /* Return zero on success, -1 on failure */
static int static int
do_view_init (WView *view, char *_command, const char *_file, do_view_init (WView *view, const char *_command, const char *_file,
int start_line) int start_line)
{ {
char *error = 0; char *error = 0;
@ -758,7 +758,7 @@ view_update_bytes_per_line (WView *view)
/* Both views */ /* Both views */
/* Return zero on success, -1 on failure */ /* Return zero on success, -1 on failure */
int int
view_init (WView *view, char *_command, const char *_file, int start_line) view_init (WView *view, const char *_command, const char *_file, int start_line)
{ {
if (!view->view_active || strcmp (_file, view->filename) if (!view->view_active || strcmp (_file, view->filename)
|| altered_magic_flag) || altered_magic_flag)
@ -2623,7 +2623,7 @@ view_dialog_callback (Dlg_head *h, dlg_msg_t msg, int parm)
/* Real view only */ /* Real view only */
int int
view (char *_command, const char *_file, int *move_dir_p, int start_line) view (const char *_command, const char *_file, int *move_dir_p, int start_line)
{ {
int error; int error;
WView *wview; WView *wview;

Просмотреть файл

@ -6,15 +6,15 @@ typedef struct WView WView;
/* Creation/initialization of a new view widget */ /* Creation/initialization of a new view widget */
WView *view_new (int y, int x, int cols, int lines, int is_panel); WView *view_new (int y, int x, int cols, int lines, int is_panel);
int view_init (WView *view, char *_command, const char *_file, int view_init (WView *view, const char *_command, const char *_file,
int start_line); int start_line);
void view_update_bytes_per_line (WView *view); void view_update_bytes_per_line (WView *view);
/* Command: view a file, if _command != NULL we use popen on _command */ /* Command: view a _file, if _command != NULL we use popen on _command */
/* move direction should be apointer that will hold the direction in which the user */ /* move direction should be a pointer that will hold the direction in which */
/* wants to move (-1 previous file, 1 next file, 0 do nothing) */ /* the user wants to move (-1 previous file, 1 next file, 0 do nothing) */
int view (char *_command, const char *_file, int *move_direction, int view (const char *_command, const char *_file, int *move_direction,
int start_line); int start_line);
extern int mouse_move_pages_viewer; extern int mouse_move_pages_viewer;