From 64eed6e12b65c7dc4a699ff68f4dec0346c81c47 Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Mon, 7 Feb 2005 06:02:59 +0000 Subject: [PATCH] * edit.h (catstrs): Changed the return type to "const char *". * editcmd.c (catstrs): Likewise. * edit.c (user_menu): Added const qualifiers. * editcmd.c: Likewise. * syntax.c: Likewise. --- edit/ChangeLog | 8 ++++++++ edit/edit.c | 2 +- edit/edit.h | 2 +- edit/editcmd.c | 12 ++++++------ edit/syntax.c | 2 +- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/edit/ChangeLog b/edit/ChangeLog index 0272fefcc..977872004 100644 --- a/edit/ChangeLog +++ b/edit/ChangeLog @@ -1,3 +1,11 @@ +2005-02-07 Roland Illig + + * edit.h (catstrs): Changed the return type to "const char *". + * editcmd.c (catstrs): Likewise. + * edit.c (user_menu): Added const qualifiers. + * editcmd.c: Likewise. + * syntax.c: Likewise. + 2005-02-07 Roland Illig * edit.c: Improved message formatting. diff --git a/edit/edit.c b/edit/edit.c index e677fae43..03834f9ca 100644 --- a/edit/edit.c +++ b/edit/edit.c @@ -2641,7 +2641,7 @@ user_menu (WEdit * edit) int nomark; struct stat status; long start_mark, end_mark; - char *block_file = catstrs (home_dir, BLOCK_FILE, (char *) NULL); + const char *block_file = catstrs (home_dir, BLOCK_FILE, (char *) NULL); int rc = 0; nomark = eval_marks (edit, &start_mark, &end_mark); diff --git a/edit/edit.h b/edit/edit.h index e3cea81c0..57647a62c 100644 --- a/edit/edit.h +++ b/edit/edit.h @@ -186,7 +186,7 @@ int edit_save_block_cmd (WEdit * edit); int edit_insert_file_cmd (WEdit * edit); int edit_insert_file (WEdit * edit, const char *filename); void edit_block_process_cmd (WEdit * edit, const char *shell_cmd, int block); -char *catstrs (const char *first, ...); +const char *catstrs (const char *first, ...); void freestrs (void); void edit_refresh_cmd (WEdit * edit); void edit_date_cmd (WEdit * edit); diff --git a/edit/editcmd.c b/edit/editcmd.c index c65592524..d794a4512 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -131,7 +131,7 @@ static char *stacked[16]; The result is later automatically free'd and must not be free'd by the caller. */ -char *catstrs (const char *first,...) +const char *catstrs (const char *first,...) { static int i = 0; va_list ap; @@ -583,7 +583,7 @@ edit_raw_key_query (const char *heading, const char *query, int cancel) /* creates a macro file if it doesn't exist */ static FILE *edit_open_macro_file (const char *r) { - char *filename; + const char *filename; int file; filename = catstrs (home_dir, MACRO_FILE, (char *) NULL); if ((file = open (filename, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1) @@ -761,7 +761,7 @@ int edit_load_macro_cmd (WEdit * edit, struct macro macro[], int *n, int k) /* returns 1 on success */ int edit_save_confirm_cmd (WEdit * edit) { - char *f; + const char *f; if (edit_confirm_save) { f = catstrs (_(" Confirm save file? : "), edit->filename, " ", (char *) NULL); @@ -2452,9 +2452,9 @@ edit_block_process_cmd (WEdit *edit, const char *shell_cmd, int block) FILE *script_home = NULL; FILE *script_src = NULL; FILE *block_file = NULL; - char *o = NULL; - char *h = NULL; - char *b = NULL; + const char *o = NULL; + const char *h = NULL; + const char *b = NULL; char *quoted_name = NULL; o = catstrs (mc_home, shell_cmd, (char *) NULL); /* original source script */ diff --git a/edit/syntax.c b/edit/syntax.c index 664f23323..fd69edca0 100644 --- a/edit/syntax.c +++ b/edit/syntax.c @@ -1094,7 +1094,7 @@ void edit_load_syntax (WEdit *edit, char **names, const char *type) { int r; - char *f; + const char *f; edit_free_syntax_rules (edit);