diff --git a/src/filegui.c b/src/filegui.c index 3c5afab32..5ad775e37 100644 --- a/src/filegui.c +++ b/src/filegui.c @@ -96,7 +96,7 @@ typedef struct { /* Query replace dialog */ Dlg_head *replace_dlg; - char *replace_filename; + const char *replace_filename; int replace_result; struct stat *s_stat, *d_stat; } FileOpContextUI; @@ -171,8 +171,8 @@ file_op_context_create_ui (FileOpContext *ctx, int with_eta) int x_size; int minus; int eta_offset; - char *sixty; - char *fifteen; + const char *sixty; + const char *fifteen; g_return_if_fail (ctx != NULL); g_return_if_fail (ctx->ui == NULL); @@ -506,7 +506,7 @@ file_progress_show_deleting (FileOpContext *ctx, const char *s) * alex */ static struct { - char *text; + const char *text; int ypos, xpos; int value; /* 0 for labels */ } rd_widgets[] = { diff --git a/src/filenot.c b/src/filenot.c index 281f6f5ba..420aacacd 100644 --- a/src/filenot.c +++ b/src/filenot.c @@ -28,7 +28,7 @@ #include "global.h" static char * -get_absolute_name (char *file) +get_absolute_name (const char *file) { char dir[MC_MAXPATHLEN]; @@ -70,9 +70,10 @@ my_mkdir_rec (char *s, mode_t mode) } int -my_mkdir (char *s, mode_t mode) +my_mkdir (const char *s, mode_t mode) { int result; + char *my_s; result = mc_mkdir (s, mode); if (result) { @@ -82,21 +83,22 @@ my_mkdir (char *s, mode_t mode) g_free (p); } if (result == 0) { - s = get_absolute_name (s); + my_s = get_absolute_name (s); #ifdef FIXME - tree_add_entry (tree, s); + tree_add_entry (tree, my_s); #endif - g_free (s); + g_free (my_s); } return result; } int -my_rmdir (char *s) +my_rmdir (const char *s) { int result; + char *my_s; #ifdef FIXME WTree *tree = 0; #endif @@ -104,13 +106,13 @@ my_rmdir (char *s) /* FIXME: Should receive a Wtree! */ result = mc_rmdir (s); if (result == 0) { - s = get_absolute_name (s); + my_s = get_absolute_name (s); #ifdef FIXME - tree_remove_entry (tree, s); + tree_remove_entry (tree, my_s); #endif - g_free (s); + g_free (my_s); } return result; } diff --git a/src/fileopctx.h b/src/fileopctx.h index 0b2845fa6..e3a5233a4 100644 --- a/src/fileopctx.h +++ b/src/fileopctx.h @@ -115,7 +115,7 @@ FileOpContext *file_op_context_new (FileOperation op); void file_op_context_destroy (FileOpContext *ctx); -extern char *op_names [3]; +extern const char *op_names [3]; typedef enum { FILE_CONT, diff --git a/src/find.c b/src/find.c index f66c605fe..a581924cb 100644 --- a/src/find.c +++ b/src/find.c @@ -173,15 +173,15 @@ find_parameters (char **start_dir, char **pattern, char **content) { int return_value; char *temp_dir; - static char *case_label = N_("case &Sensitive"); + static const char *case_label = N_("case &Sensitive"); static char *in_contents = NULL; static char *in_start_dir = NULL; static char *in_start_name = NULL; - static char *labs[] = + static const char *labs[] = { N_("Start at:"), N_("Filename:"), N_("Content: ") }; - static char *buts[] = { N_("&OK"), N_("&Tree"), N_("&Cancel") }; + static const char *buts[] = { N_("&OK"), N_("&Tree"), N_("&Cancel") }; static int ilen = 30, istart = 14; static int b0 = 3, b1 = 16, b2 = 36; @@ -611,7 +611,7 @@ do_search (struct Dlg_head *h) count++; if (!(count & 31)){ /* For nice updating */ - char *rotating_dash = "|/-\\"; + const char *rotating_dash = "|/-\\"; if (verbose){ pos = (pos + 1) % 4;