merged 158_message_codes branch

This commit is contained in:
Enrico Weigelt, metux IT service 2009-01-24 04:53:51 +01:00
commit 5d150562aa
38 changed files with 198 additions and 178 deletions

View File

@ -6,8 +6,7 @@
2009-01-18 Patrick Winnertz <winnie@debian.org> 2009-01-18 Patrick Winnertz <winnie@debian.org>
* edit/editdraw.c: Moved var into if clause as it's only used * edit/editdraw.c: Moved var into if clause as it's only used there
there
* edit/editlock.c: Removed unnecessary arguement to if condition * edit/editlock.c: Removed unnecessary arguement to if condition
* src/cmd.c: Removed unused pointer * src/cmd.c: Removed unused pointer
* src/hotlist.c: Removed unused function save_group * src/hotlist.c: Removed unused function save_group
@ -44,6 +43,22 @@
added syntax definition for Haskell (taken from rhclub-tree) added syntax definition for Haskell (taken from rhclub-tree)
* syntax: added ebuild Syntax defition (taken from rhclub-tree) * syntax: added ebuild Syntax defition (taken from rhclub-tree)
2009-01-10 Enrico Weigelt, metux ITS <weigelt@metux.de>
* edit/editcmd.c:
* src/achown.c src/background.c src/boxes.c src/chmod.c:
* src/chown.c src/cmd.c src/command.c src/dir.c src/execute.c:
* src/ext.c src/file.c src/filegui.c src/find.c src/help.c:
* src/learn.c src/main.c src/panelize.c src/screen.c:
* src/selcodepage.c src/subshell.c src/tree.c src/user.c:
* src/utilunix.c src/view.c:
* vfs/cpio.c vfs/direntry.c vfs/extfs.c vfs/fish.c vfs/ftpfs.c:
* vfs/mcfs.c vfs/sfs.c vfs/smbfs.c vfs/tar.c vfs/undelfs.c:
* vfs/utilvfs.c vfs/vfs.c:
Changed message type codes on calls to message(), query_dialog(),
close_error_pipe() from numeric IDs to symbols D_ERROR, D_NORMAL
2008-12-18 Roland Illig <roland.illig@gmx.de> 2008-12-18 Roland Illig <roland.illig@gmx.de>
* doc/mcedit.1: Documented the newly added filename:lineno * doc/mcedit.1: Documented the newly added filename:lineno

View File

@ -2051,7 +2051,7 @@ edit_replace_cmd (WEdit *edit, int again)
edit->force |= REDRAW_PAGE; edit->force |= REDRAW_PAGE;
edit_render_keypress (edit); edit_render_keypress (edit);
if (times_replaced) { if (times_replaced) {
message (0, msg, _(" %ld replacements made. "), message (D_NORMAL, msg, _(" %ld replacements made. "),
times_replaced); times_replaced);
} else } else
query_dialog (msg, _(" Search string not found "), query_dialog (msg, _(" Search string not found "),
@ -2130,7 +2130,7 @@ void edit_search_cmd (WEdit * edit, int again)
} }
if (found) { if (found) {
/* in response to number of bookmarks added because of string being found %d times */ /* in response to number of bookmarks added because of string being found %d times */
message (0, _("Search"), _(" %d items found, %d bookmarks added "), found, books); message (D_NORMAL, _("Search"), _(" %d items found, %d bookmarks added "), found, books);
} else { } else {
edit_error_dialog (_ ("Search"), _ (" Search string not found ")); edit_error_dialog (_ ("Search"), _ (" Search string not found "));
} }
@ -2584,7 +2584,7 @@ edit_block_process_cmd (WEdit *edit, const char *shell_cmd, int block)
quoted_name, (char *) NULL)); quoted_name, (char *) NULL));
} }
g_free (quoted_name); g_free (quoted_name);
close_error_pipe (0, 0); close_error_pipe (D_NORMAL, NULL);
edit_refresh_cmd (edit); edit_refresh_cmd (edit);
edit->force |= REDRAW_COMPLETELY; edit->force |= REDRAW_COMPLETELY;

View File

@ -627,12 +627,12 @@ static void apply_advanced_chowns (struct stat *sf)
fname = current_panel->dir.list[current_file].fname; fname = current_panel->dir.list[current_file].fname;
need_update = end_chown = 1; need_update = end_chown = 1;
if (mc_chmod (fname, get_mode ()) == -1) if (mc_chmod (fname, get_mode ()) == -1)
message (1, MSG_ERROR, _(" Cannot chmod \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chmod \"%s\" \n %s "),
fname, unix_error_string (errno)); fname, unix_error_string (errno));
/* call mc_chown only, if mc_chmod didn't fail */ /* call mc_chown only, if mc_chmod didn't fail */
else if (mc_chown (fname, (ch_flags[9] == '+') ? sf->st_uid : (uid_t) -1, else if (mc_chown (fname, (ch_flags[9] == '+') ? sf->st_uid : (uid_t) -1,
(ch_flags[10] == '+') ? sf->st_gid : (gid_t) -1) == -1) (ch_flags[10] == '+') ? sf->st_gid : (gid_t) -1) == -1)
message (1, MSG_ERROR, _(" Cannot chown \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chown \"%s\" \n %s "),
fname, unix_error_string (errno)); fname, unix_error_string (errno));
do_file_mark (current_panel, current_file, 0); do_file_mark (current_panel, current_file, 0);
@ -643,12 +643,12 @@ static void apply_advanced_chowns (struct stat *sf)
break; break;
ch_cmode = sf->st_mode; ch_cmode = sf->st_mode;
if (mc_chmod (fname, get_mode ()) == -1) if (mc_chmod (fname, get_mode ()) == -1)
message (1, MSG_ERROR, _(" Cannot chmod \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chmod \"%s\" \n %s "),
fname, unix_error_string (errno)); fname, unix_error_string (errno));
/* call mc_chown only, if mc_chmod didn't fail */ /* call mc_chown only, if mc_chmod didn't fail */
else if (mc_chown (fname, (ch_flags[9] == '+') ? a_uid : (uid_t) -1, else if (mc_chown (fname, (ch_flags[9] == '+') ? a_uid : (uid_t) -1,
(ch_flags[10] == '+') ? a_gid : (gid_t) -1) == -1) (ch_flags[10] == '+') ? a_gid : (gid_t) -1) == -1)
message (1, MSG_ERROR, _(" Cannot chown \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chown \"%s\" \n %s "),
fname, unix_error_string (errno)); fname, unix_error_string (errno));
do_file_mark (current_panel, current_file, 0); do_file_mark (current_panel, current_file, 0);
@ -690,12 +690,12 @@ chown_advanced_cmd (void)
case B_ENTER: case B_ENTER:
need_update = 1; need_update = 1;
if (mc_chmod (fname, get_mode ()) == -1) if (mc_chmod (fname, get_mode ()) == -1)
message (1, MSG_ERROR, _(" Cannot chmod \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chmod \"%s\" \n %s "),
fname, unix_error_string (errno)); fname, unix_error_string (errno));
/* call mc_chown only, if mc_chmod didn't fail */ /* call mc_chown only, if mc_chmod didn't fail */
else if (mc_chown (fname, (ch_flags[9] == '+') ? sf_stat->st_uid : (uid_t) -1, else if (mc_chown (fname, (ch_flags[9] == '+') ? sf_stat->st_uid : (uid_t) -1,
(ch_flags[10] == '+') ? sf_stat->st_gid : (gid_t) -1) == -1) (ch_flags[10] == '+') ? sf_stat->st_gid : (gid_t) -1) == -1)
message (1, MSG_ERROR, _(" Cannot chown \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chown \"%s\" \n %s "),
fname, unix_error_string (errno)); fname, unix_error_string (errno));
break; break;
case B_SETALL: case B_SETALL:

View File

@ -213,7 +213,7 @@ background_attention (int fd, void *closure)
if (!waitpid (ctx->pid, &status, WNOHANG)) { if (!waitpid (ctx->pid, &status, WNOHANG)) {
/* the process is still running, but it misbehaves - kill it */ /* the process is still running, but it misbehaves - kill it */
kill (ctx->pid, SIGTERM); kill (ctx->pid, SIGTERM);
message (1, background_process_error, _(" Unknown error in child ")); message (D_ERROR, background_process_error, _(" Unknown error in child "));
return 0; return 0;
} }
@ -221,14 +221,14 @@ background_attention (int fd, void *closure)
if (WIFEXITED (status) && (WEXITSTATUS (status) == 0)) if (WIFEXITED (status) && (WEXITSTATUS (status) == 0))
return 0; return 0;
message (1, background_process_error, _(" Child died unexpectedly ")); message (D_ERROR, background_process_error, _(" Child died unexpectedly "));
return 0; return 0;
} }
read (fd, &argc, sizeof (argc)); read (fd, &argc, sizeof (argc));
if (argc > MAXCALLARGS){ if (argc > MAXCALLARGS){
message (1, _(" Background protocol error "), message (D_ERROR, _(" Background protocol error "),
_(" Background process sent us a request for more arguments \n" _(" Background process sent us a request for more arguments \n"
" than we can handle. \n")); " than we can handle. \n"));
} }

View File

@ -629,7 +629,7 @@ display_bits_box (void)
errmsg = errmsg =
init_translation_table (source_codepage, display_codepage); init_translation_table (source_codepage, display_codepage);
if (errmsg) if (errmsg)
message (1, MSG_ERROR, "%s", errmsg); message (D_ERROR, MSG_ERROR, "%s", errmsg);
#ifndef HAVE_SLANG #ifndef HAVE_SLANG
meta (stdscr, display_codepage != 0); meta (stdscr, display_codepage != 0);
#else #else

View File

@ -243,7 +243,7 @@ static void do_chmod (struct stat *sf)
sf->st_mode &= and_mask; sf->st_mode &= and_mask;
sf->st_mode |= or_mask; sf->st_mode |= or_mask;
if (mc_chmod (current_panel->dir.list [c_file].fname, sf->st_mode) == -1) if (mc_chmod (current_panel->dir.list [c_file].fname, sf->st_mode) == -1)
message (1, MSG_ERROR, _(" Cannot chmod \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chmod \"%s\" \n %s "),
current_panel->dir.list [c_file].fname, unix_error_string (errno)); current_panel->dir.list [c_file].fname, unix_error_string (errno));
do_file_mark (current_panel, c_file, 0); do_file_mark (current_panel, c_file, 0);
@ -313,7 +313,7 @@ void chmod_cmd (void)
case B_ENTER: case B_ENTER:
if (mode_change) if (mode_change)
if (mc_chmod (fname, c_stat) == -1) if (mc_chmod (fname, c_stat) == -1)
message (1, MSG_ERROR, _(" Cannot chmod \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chmod \"%s\" \n %s "),
fname, unix_error_string (errno)); fname, unix_error_string (errno));
need_update = 1; need_update = 1;
break; break;

View File

@ -211,7 +211,7 @@ static inline void
do_chown (uid_t u, gid_t g) do_chown (uid_t u, gid_t g)
{ {
if (mc_chown (current_panel->dir.list [current_file].fname, u, g) == -1) if (mc_chown (current_panel->dir.list [current_file].fname, u, g) == -1)
message (1, MSG_ERROR, _(" Cannot chown \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chown \"%s\" \n %s "),
current_panel->dir.list [current_file].fname, unix_error_string (errno)); current_panel->dir.list [current_file].fname, unix_error_string (errno));
do_file_mark (current_panel, current_file, 0); do_file_mark (current_panel, current_file, 0);
@ -319,7 +319,7 @@ chown_cmd (void)
if (ch_dlg->ret_value==B_ENTER) { if (ch_dlg->ret_value==B_ENTER) {
need_update = 1; need_update = 1;
if (mc_chown (fname, new_user, new_group) == -1) if (mc_chown (fname, new_user, new_group) == -1)
message (1, MSG_ERROR, _(" Cannot chown \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chown \"%s\" \n %s "),
fname, unix_error_string (errno)); fname, unix_error_string (errno));
} else } else
apply_chowns (new_user, new_group); apply_chowns (new_user, new_group);

View File

@ -189,13 +189,13 @@ do_view_cmd (int normal)
|| link_isdir (selection (current_panel))) { || link_isdir (selection (current_panel))) {
if (confirm_view_dir && (current_panel->marked || current_panel->dirs_marked)) { if (confirm_view_dir && (current_panel->marked || current_panel->dirs_marked)) {
if (query_dialog if (query_dialog
(_(" Confirmation "), _("Files tagged, want to cd?"), 0, 2, (_(" Confirmation "), _("Files tagged, want to cd?"), D_NORMAL, 2,
_("&Yes"), _("&No")) != 0) { _("&Yes"), _("&No")) != 0) {
return; return;
} }
} }
if (!do_cd (selection (current_panel)->fname, cd_exact)) if (!do_cd (selection (current_panel)->fname, cd_exact))
message (1, MSG_ERROR, _("Cannot change directory")); message (D_ERROR, MSG_ERROR, _("Cannot change directory"));
return; return;
@ -365,7 +365,7 @@ mkdir_cmd (void)
repaint_screen (); repaint_screen ();
select_item (current_panel); select_item (current_panel);
} else { } else {
message (1, MSG_ERROR, " %s ", unix_error_string (errno)); message (D_ERROR, MSG_ERROR, " %s ", unix_error_string (errno));
} }
g_free (absdir); g_free (absdir);
@ -508,7 +508,7 @@ select_unselect_cmd (const char *title, int cmd)
c = regexp_match (reg_exp_t, current_panel->dir.list[i].fname, c = regexp_match (reg_exp_t, current_panel->dir.list[i].fname,
match_file); match_file);
if (c == -1) { if (c == -1) {
message (1, MSG_ERROR, _(" Malformed regular expression ")); message (D_ERROR, MSG_ERROR, _(" Malformed regular expression "));
g_free (reg_exp); g_free (reg_exp);
return; return;
} }
@ -560,7 +560,7 @@ void ext_cmd (void)
dir = 0; dir = 0;
if (geteuid () == 0){ if (geteuid () == 0){
dir = query_dialog (_("Extension file edit"), dir = query_dialog (_("Extension file edit"),
_(" Which extension file you want to edit? "), 0, 2, _(" Which extension file you want to edit? "), D_NORMAL, 2,
_("&User"), _("&System Wide")); _("&User"), _("&System Wide"));
} }
extdir = concat_dir_and_file (mc_home, MC_LIB_EXT); extdir = concat_dir_and_file (mc_home, MC_LIB_EXT);
@ -589,7 +589,7 @@ menu_edit_cmd (int where)
dir = query_dialog ( dir = query_dialog (
_(" Menu edit "), _(" Menu edit "),
_(" Which menu file do you want to edit? "), _(" Which menu file do you want to edit? "),
0, geteuid() ? 2 : 3, D_NORMAL, geteuid() ? 2 : 3,
_("&Local"), _("&User"), _("&System Wide") _("&Local"), _("&User"), _("&System Wide")
); );
@ -633,7 +633,7 @@ void quick_chdir_cmd (void)
tree_chdir (the_tree, target); tree_chdir (the_tree, target);
else else
if (!do_cd (target, cd_exact)) if (!do_cd (target, cd_exact))
message (1, MSG_ERROR, _("Cannot change directory") ); message (D_ERROR, MSG_ERROR, _("Cannot change directory") );
g_free (target); g_free (target);
} }
@ -663,7 +663,7 @@ edit_syntax_cmd (void)
if (geteuid () == 0) { if (geteuid () == 0) {
dir = dir =
query_dialog (_("Syntax file edit"), query_dialog (_("Syntax file edit"),
_(" Which syntax file you want to edit? "), 0, 2, _(" Which syntax file you want to edit? "), D_NORMAL, 2,
_("&User"), _("&System Wide")); _("&User"), _("&System Wide"));
} }
extdir = concat_dir_and_file (mc_home, "syntax" PATH_SEP_STR "Syntax"); extdir = concat_dir_and_file (mc_home, "syntax" PATH_SEP_STR "Syntax");
@ -690,7 +690,7 @@ void reselect_vfs (void)
return; return;
if (!do_cd (target, cd_exact)) if (!do_cd (target, cd_exact))
message (1, MSG_ERROR, _("Cannot change directory") ); message (D_ERROR, MSG_ERROR, _("Cannot change directory") );
g_free (target); g_free (target);
} }
#endif /* USE_VFS */ #endif /* USE_VFS */
@ -818,8 +818,8 @@ compare_dirs_cmd (void)
choice = choice =
query_dialog (_(" Compare directories "), query_dialog (_(" Compare directories "),
_(" Select compare method: "), 0, 3, _("&Quick"), _(" Select compare method: "), 0, D_NORMAL,
_("&Size only"), _("&Thorough"), _("&Cancel")); _("&Quick"), _("&Size only"), _("&Thorough"), _("&Cancel"));
if (choice < 0 || choice > 2) if (choice < 0 || choice > 2)
return; return;
@ -831,7 +831,7 @@ compare_dirs_cmd (void)
compare_dir (current_panel, other_panel, thorough_flag); compare_dir (current_panel, other_panel, thorough_flag);
compare_dir (other_panel, current_panel, thorough_flag); compare_dir (other_panel, current_panel, thorough_flag);
} else { } else {
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" Both panels should be in the " _(" Both panels should be in the "
"listing mode to use this command ")); "listing mode to use this command "));
} }
@ -848,7 +848,7 @@ history_cmd (void)
cmdline->need_push = 0; cmdline->need_push = 0;
} }
if (!cmdline->history) { if (!cmdline->history) {
message (1, MSG_ERROR, _(" The command history is empty ")); message (D_ERROR, MSG_ERROR, _(" The command history is empty "));
return; return;
} }
current = g_list_first (cmdline->history); current = g_list_first (cmdline->history);
@ -887,7 +887,7 @@ view_other_cmd (void)
if (!xterm_flag && !console_flag && !use_subshell && !output_starts_shell) { if (!xterm_flag && !console_flag && !use_subshell && !output_starts_shell) {
if (message_flag) if (message_flag)
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" Not an xterm or Linux console; \n" _(" Not an xterm or Linux console; \n"
" the panels cannot be toggled. ")); " the panels cannot be toggled. "));
message_flag = FALSE; message_flag = FALSE;
@ -908,7 +908,7 @@ do_link (int symbolic_link, const char *fname)
goto cleanup; goto cleanup;
save_cwds_stat (); save_cwds_stat ();
if (-1 == mc_link (fname, dest)) if (-1 == mc_link (fname, dest))
message (1, MSG_ERROR, _(" link: %s "), message (D_ERROR, MSG_ERROR, _(" link: %s "),
unix_error_string (errno)); unix_error_string (errno));
} else { } else {
char *s; char *s;
@ -931,7 +931,7 @@ do_link (int symbolic_link, const char *fname)
goto cleanup; goto cleanup;
save_cwds_stat (); save_cwds_stat ();
if (-1 == mc_symlink (dest, src)) if (-1 == mc_symlink (dest, src))
message (1, MSG_ERROR, _(" symlink: %s "), message (D_ERROR, MSG_ERROR, _(" symlink: %s "),
unix_error_string (errno)); unix_error_string (errno));
} }
update_panels (UP_OPTIMIZE, UP_KEEPSEL); update_panels (UP_OPTIMIZE, UP_KEEPSEL);
@ -977,11 +977,11 @@ void edit_symlink_cmd (void)
if (*dest && strcmp (buffer, dest)) { if (*dest && strcmp (buffer, dest)) {
save_cwds_stat (); save_cwds_stat ();
if (-1 == mc_unlink (p)){ if (-1 == mc_unlink (p)){
message (1, MSG_ERROR, _(" edit symlink, unable to remove %s: %s "), message (D_ERROR, MSG_ERROR, _(" edit symlink, unable to remove %s: %s "),
p, unix_error_string (errno)); p, unix_error_string (errno));
} else { } else {
if (-1 == mc_symlink (dest, p)) if (-1 == mc_symlink (dest, p))
message (1, MSG_ERROR, _(" edit symlink: %s "), message (D_ERROR, MSG_ERROR, _(" edit symlink: %s "),
unix_error_string (errno)); unix_error_string (errno));
} }
update_panels (UP_OPTIMIZE, UP_KEEPSEL); update_panels (UP_OPTIMIZE, UP_KEEPSEL);
@ -992,7 +992,7 @@ void edit_symlink_cmd (void)
} }
g_free (q); g_free (q);
} else { } else {
message (1, MSG_ERROR, _("`%s' is not a symbolic link"), message (D_ERROR, MSG_ERROR, _("`%s' is not a symbolic link"),
selection (current_panel)->fname); selection (current_panel)->fname);
} }
} }
@ -1110,7 +1110,7 @@ nice_cd (const char *text, const char *xtext, const char *help, const char *pref
if (do_panel_cd (MENU_PANEL, cd_path, 0)) if (do_panel_cd (MENU_PANEL, cd_path, 0))
directory_history_add (MENU_PANEL, (MENU_PANEL)->cwd); directory_history_add (MENU_PANEL, (MENU_PANEL)->cwd);
else else
message (1, MSG_ERROR, _(" Cannot chdir to %s "), cd_path); message (D_ERROR, MSG_ERROR, _(" Cannot chdir to %s "), cd_path);
g_free (cd_path); g_free (cd_path);
g_free (machine); g_free (machine);
} }
@ -1223,10 +1223,15 @@ dirsizes_cmd (void)
void void
save_setup_cmd (void) save_setup_cmd (void)
{ {
<<<<<<< HEAD:src/cmd.c
=======
char *str;
>>>>>>> origin/158_message_codes:src/cmd.c
save_setup (); save_setup ();
sync_profiles (); sync_profiles ();
message (0, _(" Setup "), _(" Setup saved to ~/%s"), PROFILE_NAME); message (D_NORMAL, _(" Setup "), _(" Setup saved to ~/%s"), PROFILE_NAME);
} }
static void static void

View File

@ -183,7 +183,7 @@ void do_cd_command (char *cmd)
} else } else
if (!examine_cd (&cmd [3])) { if (!examine_cd (&cmd [3])) {
char *d = strip_password (g_strdup (&cmd [3]), 1); char *d = strip_password (g_strdup (&cmd [3]), 1);
message (1, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "),
d, unix_error_string (errno)); d, unix_error_string (errno));
g_free (d); g_free (d);
return; return;
@ -215,7 +215,7 @@ enter (WInput *cmdline)
size_t i, j, cmd_len; size_t i, j, cmd_len;
if (!vfs_current_is_local ()) { if (!vfs_current_is_local ()) {
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_ _
(" Cannot execute commands on non-local filesystems")); (" Cannot execute commands on non-local filesystems"));
@ -225,7 +225,7 @@ enter (WInput *cmdline)
/* Check this early before we clean command line /* Check this early before we clean command line
* (will be checked again by shell_execute) */ * (will be checked again by shell_execute) */
if (use_subshell && subshell_state != INACTIVE) { if (use_subshell && subshell_state != INACTIVE) {
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" The shell is already running a command ")); _(" The shell is already running a command "));
return MSG_NOT_HANDLED; return MSG_NOT_HANDLED;
} }

View File

@ -397,7 +397,7 @@ do_load_dir (const char *path, dir_list *list, sortfn *sort, int reverse,
dirp = mc_opendir (path); dirp = mc_opendir (path);
if (!dirp) { if (!dirp) {
message (1, MSG_ERROR, _("Cannot read directory contents")); message (D_ERROR, MSG_ERROR, _("Cannot read directory contents"));
return next_free; return next_free;
} }
tree_store_start_check (path); tree_store_start_check (path);
@ -496,7 +496,7 @@ do_reload_dir (const char *path, dir_list *list, sortfn *sort, int count,
dirp = mc_opendir (path); dirp = mc_opendir (path);
if (!dirp) { if (!dirp) {
message (1, MSG_ERROR, _("Cannot read directory contents")); message (D_ERROR, MSG_ERROR, _("Cannot read directory contents"));
clean_dir (list, count); clean_dir (list, count);
return set_zero_dir (list); return set_zero_dir (list);
} }

View File

@ -189,7 +189,7 @@ shell_execute (const char *command, int flags)
if (subshell_state == INACTIVE) if (subshell_state == INACTIVE)
do_execute (shell, cmd ? cmd : command, flags | EXECUTE_AS_SHELL); do_execute (shell, cmd ? cmd : command, flags | EXECUTE_AS_SHELL);
else else
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" The shell is already running a command ")); _(" The shell is already running a command "));
else else
#endif /* HAVE_SUBSHELL_SUPPORT */ #endif /* HAVE_SUBSHELL_SUPPORT */
@ -352,7 +352,7 @@ execute_with_vfs_arg (const char *command, const char *filename)
localcopy = mc_getlocalcopy (filename); localcopy = mc_getlocalcopy (filename);
if (localcopy == NULL) { if (localcopy == NULL) {
message (1, MSG_ERROR, _(" Cannot fetch a local copy of %s "), message (D_ERROR, MSG_ERROR, _(" Cannot fetch a local copy of %s "),
filename); filename);
return; return;
} }

View File

@ -100,7 +100,7 @@ exec_extension (const char *filename, const char *data, int *move_dir,
cmd_file_fd = mc_mkstemps (&file_name, "mcext", SCRIPT_SUFFIX); cmd_file_fd = mc_mkstemps (&file_name, "mcext", SCRIPT_SUFFIX);
if (cmd_file_fd == -1) { if (cmd_file_fd == -1) {
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" Cannot create temporary command file \n %s "), _(" Cannot create temporary command file \n %s "),
unix_error_string (errno)); unix_error_string (errno));
return; return;
@ -464,7 +464,7 @@ regex_command (const char *filename, const char *action, int *move_dir)
char *title = char *title =
g_strdup_printf (_(" %s%s file error"), g_strdup_printf (_(" %s%s file error"),
mc_home, MC_LIB_EXT); mc_home, MC_LIB_EXT);
message (1, title, _("The format of the %smc.ext " message (D_ERROR, title, _("The format of the %smc.ext "
"file has changed with version 3.0. It seems that " "file has changed with version 3.0. It seems that "
"the installation failed. Please fetch a fresh " "the installation failed. Please fetch a fresh "
"copy from the Midnight Commander package."), "copy from the Midnight Commander package."),
@ -477,7 +477,7 @@ regex_command (const char *filename, const char *action, int *move_dir)
if (home_error) { if (home_error) {
char *title = char *title =
g_strdup_printf (_(" ~/%s file error "), MC_USER_EXT); g_strdup_printf (_(" ~/%s file error "), MC_USER_EXT);
message (1, title, _("The format of the ~/%s file has " message (D_ERROR, title, _("The format of the ~/%s file has "
"changed with version 3.0. You may either want to copy " "changed with version 3.0. You may either want to copy "
"it from %smc.ext or use that file as an example of how " "it from %smc.ext or use that file as an example of how "
"to write it."), MC_USER_EXT, mc_home); "to write it."), MC_USER_EXT, mc_home);

View File

@ -212,7 +212,7 @@ do_transform_source (FileOpContext *ctx, const char *source)
case '*': case '*':
if (next_reg < 0 || next_reg >= RE_NREGS if (next_reg < 0 || next_reg >= RE_NREGS
|| ctx->regs.start[next_reg] < 0) { || ctx->regs.start[next_reg] < 0) {
message (1, MSG_ERROR, _(" Invalid target mask ")); message (D_ERROR, MSG_ERROR, _(" Invalid target mask "));
transform_error = FILE_ABORT; transform_error = FILE_ABORT;
return NULL; return NULL;
} }
@ -312,7 +312,7 @@ check_hardlinks (const char *src_name, const char *dst_name, struct stat *pstat)
} }
} }
} }
message (1, MSG_ERROR, _(" Cannot make the hardlink ")); message (D_ERROR, MSG_ERROR, _(" Cannot make the hardlink "));
return 0; return 0;
} }
lp = (struct link *) g_malloc (sizeof (struct link) + strlen (src_name) lp = (struct link *) g_malloc (sizeof (struct link) + strlen (src_name)
@ -366,7 +366,7 @@ make_symlink (FileOpContext *ctx, const char *src_path, const char *dst_path)
if (ctx->stable_symlinks) if (ctx->stable_symlinks)
if (!vfs_file_is_local (src_path) || !vfs_file_is_local (dst_path)) { if (!vfs_file_is_local (src_path) || !vfs_file_is_local (dst_path)) {
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" Cannot make stable symlinks across " _(" Cannot make stable symlinks across "
"non-local filesystems: \n\n" "non-local filesystems: \n\n"
" Option Stable Symlinks will be disabled ")); " Option Stable Symlinks will be disabled "));
@ -510,7 +510,7 @@ copy_file_file (FileOpContext *ctx, const char *src_path, const char *dst_path,
if (dst_exists) { if (dst_exists) {
/* Destination already exists */ /* Destination already exists */
if (sb.st_dev == sb2.st_dev && sb.st_ino == sb2.st_ino) { if (sb.st_dev == sb2.st_dev && sb.st_ino == sb2.st_ino) {
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" `%s' and `%s' are the same file "), src_path, dst_path); _(" `%s' and `%s' are the same file "), src_path, dst_path);
do_refresh (); do_refresh ();
return FILE_SKIP; return FILE_SKIP;
@ -586,7 +586,7 @@ copy_file_file (FileOpContext *ctx, const char *src_path, const char *dst_path,
if (ctx->do_reget) { if (ctx->do_reget) {
if (mc_lseek (src_desc, ctx->do_reget, SEEK_SET) != ctx->do_reget) { if (mc_lseek (src_desc, ctx->do_reget, SEEK_SET) != ctx->do_reget) {
message (1, _("Warning"), message (D_ERROR, _("Warning"),
_(" Reget failed, about to overwrite file ")); _(" Reget failed, about to overwrite file "));
ctx->do_reget = ctx->do_append = 0; ctx->do_reget = ctx->do_append = 0;
} }
@ -868,7 +868,7 @@ copy_dir_dir (FileOpContext *ctx, const char *s, const char *d, int toplevel,
if (is_in_linklist (parent_dirs, s, &cbuf)) { if (is_in_linklist (parent_dirs, s, &cbuf)) {
/* we found a cyclic symbolic link */ /* we found a cyclic symbolic link */
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" Cannot copy cyclic symbolic link \n `%s' "), s); _(" Cannot copy cyclic symbolic link \n `%s' "), s);
return FILE_SKIP; return FILE_SKIP;
} }
@ -1052,14 +1052,14 @@ move_file_file (FileOpContext *ctx, const char *s, const char *d,
strcpy (st, path_trunc (s, msize)); strcpy (st, path_trunc (s, msize));
strcpy (dt, path_trunc (d, msize)); strcpy (dt, path_trunc (d, msize));
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" `%s' and `%s' are the same file "), st, dt); _(" `%s' and `%s' are the same file "), st, dt);
do_refresh (); do_refresh ();
return FILE_SKIP; return FILE_SKIP;
} }
if (S_ISDIR (dst_stats.st_mode)) { if (S_ISDIR (dst_stats.st_mode)) {
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" Cannot overwrite directory `%s' "), d); _(" Cannot overwrite directory `%s' "), d);
do_refresh (); do_refresh ();
return FILE_SKIP; return FILE_SKIP;
@ -1175,7 +1175,7 @@ move_dir_dir (FileOpContext *ctx, const char *s, const char *d,
strcpy (st, path_trunc (s, msize)); strcpy (st, path_trunc (s, msize));
strcpy (dt, path_trunc (d, msize)); strcpy (dt, path_trunc (d, msize));
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" `%s' and `%s' are the same directory "), st, dt); _(" `%s' and `%s' are the same directory "), st, dt);
do_refresh (); do_refresh ();
return FILE_SKIP; return FILE_SKIP;
@ -1753,7 +1753,7 @@ panel_operate (void *source_panel, FileOperation operation,
} }
if (!strcmp (source, "..")) { if (!strcmp (source, "..")) {
message (1, MSG_ERROR, _(" Cannot operate on \"..\"! ")); message (D_ERROR, MSG_ERROR, _(" Cannot operate on \"..\"! "));
return 0; return 0;
} }
} }
@ -1808,7 +1808,7 @@ panel_operate (void *source_panel, FileOperation operation,
g_strconcat (op_names[operation], ": ", g_strconcat (op_names[operation], ": ",
panel->cwd, NULL)); panel->cwd, NULL));
if (v == -1) { if (v == -1) {
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" Sorry, I could not put the job in background ")); _(" Sorry, I could not put the job in background "));
} }

View File

@ -868,7 +868,7 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, const char *text,
g_return_val_if_fail (ctx != NULL, NULL); g_return_val_if_fail (ctx != NULL, NULL);
#if 0 #if 0
message (1, __FUNCTION__, "text = `%s' \n def_text = `%s'", text, message (D_ERROR, __FUNCTION__, "text = `%s' \n def_text = `%s'", text,
def_text); def_text);
#endif #endif
fmd_init_i18n (FALSE); fmd_init_i18n (FALSE);
@ -946,7 +946,7 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, const char *text,
&ctx->rx); &ctx->rx);
if (error) { if (error) {
message (1, MSG_ERROR, _("Invalid source pattern `%s' \n %s "), message (D_ERROR, MSG_ERROR, _("Invalid source pattern `%s' \n %s "),
orig_mask, error); orig_mask, error);
g_free (orig_mask); g_free (orig_mask);
goto ask_file_mask; goto ask_file_mask;

View File

@ -166,7 +166,7 @@ find_parm_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
flags |= REG_ICASE; flags |= REG_ICASE;
if (regcomp (r, in_with->buffer, flags)) { if (regcomp (r, in_with->buffer, flags)) {
message (1, MSG_ERROR, _(" Malformed regular expression ")); message (D_ERROR, MSG_ERROR, _(" Malformed regular expression "));
dlg_select_widget (in_with); dlg_select_widget (in_with);
h->running = 1; /* Don't stop the dialog */ h->running = 1; /* Don't stop the dialog */
} }

View File

@ -292,7 +292,7 @@ static void start_link_area (int x, int y, const char *link_name)
Link_Area *new; Link_Area *new;
if (inside_link_area) if (inside_link_area)
message (0, _("Warning"), _(" Internal bug: Double start of link area ")); message (D_NORMAL, _("Warning"), _(" Internal bug: Double start of link area "));
/* Allocate memory for a new link area */ /* Allocate memory for a new link area */
new = g_new (Link_Area, 1); new = g_new (Link_Area, 1);
@ -540,7 +540,7 @@ help_index_cmd (void *vp)
const char *new_item; const char *new_item;
if (!(new_item = search_string (data, "[Contents]"))) { if (!(new_item = search_string (data, "[Contents]"))) {
message (1, MSG_ERROR, _(" Cannot find node %s in help file "), message (D_ERROR, MSG_ERROR, _(" Cannot find node %s in help file "),
"[Contents]"); "[Contents]");
return; return;
} }
@ -769,7 +769,7 @@ interactive_display (const char *filename, const char *node)
data = load_mc_home_file ("mc.hlp", &hlpfile); data = load_mc_home_file ("mc.hlp", &hlpfile);
if (data == NULL) { if (data == NULL) {
message (1, MSG_ERROR, _(" Cannot open file %s \n %s "), filename ? filename : hlpfile, message (D_ERROR, MSG_ERROR, _(" Cannot open file %s \n %s "), filename ? filename : hlpfile,
unix_error_string (errno)); unix_error_string (errno));
} }
@ -783,7 +783,7 @@ interactive_display (const char *filename, const char *node)
node = "[main]"; node = "[main]";
if (!(main_node = search_string (data, node))) { if (!(main_node = search_string (data, node))) {
message (1, MSG_ERROR, _(" Cannot find node %s in help file "), message (D_ERROR, MSG_ERROR, _(" Cannot find node %s in help file "),
node); node);
/* Fallback to [main], return if it also cannot be found */ /* Fallback to [main], return if it also cannot be found */

View File

@ -113,7 +113,7 @@ _("Please press the %s\n"
} }
if (!seq_ok) { if (!seq_ok) {
message (0, _(" Cannot accept this key "), message (D_NORMAL, _(" Cannot accept this key "),
_(" You have entered \"%s\""), seq); _(" You have entered \"%s\""), seq);
} }
@ -172,11 +172,11 @@ learn_check_key (int c)
if (query_dialog (learn_title, if (query_dialog (learn_title,
_ _
("It seems that all your keys already\n" ("It seems that all your keys already\n"
"work fine. That's great."), 1, 2, "work fine. That's great."), D_ERROR, 2,
_("&Save"), _("&Discard")) == 0) _("&Save"), _("&Discard")) == 0)
learn_dlg->ret_value = B_ENTER; learn_dlg->ret_value = B_ENTER;
} else { } else {
message (1, learn_title, message (D_ERROR, learn_title,
_ _
("Great! You have a complete terminal database!\n" ("Great! You have a complete terminal database!\n"
"All your keys work well.")); "All your keys work well."));

View File

@ -425,7 +425,7 @@ void
do_possible_cd (const char *new_dir) do_possible_cd (const char *new_dir)
{ {
if (!do_cd (new_dir, cd_exact)) if (!do_cd (new_dir, cd_exact))
message (1, _("Warning"), message (D_ERROR, _("Warning"),
_(" The Commander can't change to the directory that \n" _(" The Commander can't change to the directory that \n"
" the subshell claims you are in. Perhaps you have \n" " the subshell claims you are in. Perhaps you have \n"
" deleted your working directory, or given yourself \n" " deleted your working directory, or given yourself \n"
@ -471,7 +471,7 @@ quit_cmd_internal (int quiet)
} else { } else {
if (query_dialog if (query_dialog
(_(" The Midnight Commander "), (_(" The Midnight Commander "),
_(" Do you really want to quit the Midnight Commander? "), 0, _(" Do you really want to quit the Midnight Commander? "), D_NORMAL,
2, _("&Yes"), _("&No")) == 0) 2, _("&Yes"), _("&No")) == 0)
q = 1; q = 1;
} }
@ -685,7 +685,7 @@ directory_history_list (WPanel *panel)
if (_do_panel_cd (panel, s, cd_exact)) if (_do_panel_cd (panel, s, cd_exact))
directory_history_add (panel, panel->cwd); directory_history_add (panel, panel->cwd);
else else
message (1, MSG_ERROR, _("Cannot change directory")); message (D_ERROR, MSG_ERROR, _("Cannot change directory"));
g_free (s); g_free (s);
} }
@ -990,7 +990,7 @@ toggle_fast_reload (void)
{ {
fast_reload = !fast_reload; fast_reload = !fast_reload;
if (fast_reload_w == 0 && fast_reload) { if (fast_reload_w == 0 && fast_reload) {
message (0, _(" Information "), message (D_NORMAL, _(" Information "),
_ _
(" Using the fast reload option may not reflect the exact \n" (" Using the fast reload option may not reflect the exact \n"
" directory contents. In this case you'll need to do a \n" " directory contents. In this case you'll need to do a \n"

View File

@ -264,7 +264,7 @@ external_panelize (void)
char *target = NULL; char *target = NULL;
if (!vfs_current_is_local ()){ if (!vfs_current_is_local ()){
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" Cannot run external panelize in a non-local directory ")); _(" Cannot run external panelize in a non-local directory "));
return; return;
} }
@ -367,7 +367,7 @@ static void do_external_panelize (char *command)
open_error_pipe (); open_error_pipe ();
external = popen (command, "r"); external = popen (command, "r");
if (!external){ if (!external){
close_error_pipe (1, _("Cannot invoke command.")); close_error_pipe (D_ERROR, _("Cannot invoke command."));
return; return;
} }
/* Clear the counters and the directory list */ /* Clear the counters and the directory list */
@ -418,8 +418,8 @@ static void do_external_panelize (char *command)
current_panel->count = set_zero_dir (list); current_panel->count = set_zero_dir (list);
} }
if (pclose (external) < 0) if (pclose (external) < 0)
message (0, _("External panelize"), _("Pipe close failed")); message (D_NORMAL, _("External panelize"), _("Pipe close failed"));
close_error_pipe (0, 0); close_error_pipe (D_NORMAL, NULL);
try_to_select (current_panel, NULL); try_to_select (current_panel, NULL);
panel_re_sort (current_panel); panel_re_sort (current_panel);
} }

View File

@ -1964,7 +1964,7 @@ do_enter_on_file_entry (file_entry *fe)
if (S_ISDIR (fe->st.st_mode) || link_isdir (fe) if (S_ISDIR (fe->st.st_mode) || link_isdir (fe)
|| (fe->st.st_mode == 0)) { || (fe->st.st_mode == 0)) {
if (!do_cd (fe->fname, cd_exact)) if (!do_cd (fe->fname, cd_exact))
message (1, MSG_ERROR, _("Cannot change directory")); message (D_ERROR, MSG_ERROR, _("Cannot change directory"));
return 1; return 1;
} }
@ -1983,7 +1983,7 @@ do_enter_on_file_entry (file_entry *fe)
if (confirm_execute) { if (confirm_execute) {
if (query_dialog if (query_dialog
(_(" The Midnight Commander "), (_(" The Midnight Commander "),
_(" Do you really want to execute? "), 0, 2, _("&Yes"), _(" Do you really want to execute? "), D_NORMAL, 2, _("&Yes"),
_("&No")) != 0) _("&No")) != 0)
return 1; return 1;
} }
@ -2251,7 +2251,7 @@ panel_callback (Widget *w, widget_msg_t msg, int parm)
panel->active = 1; panel->active = 1;
if (mc_chdir (panel->cwd) != 0) { if (mc_chdir (panel->cwd) != 0) {
char *cwd = strip_password (g_strdup (panel->cwd), 1); char *cwd = strip_password (g_strdup (panel->cwd), 1);
message (1, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "),
cwd, unix_error_string (errno)); cwd, unix_error_string (errno));
g_free(cwd); g_free(cwd);
} else } else

View File

@ -99,11 +99,11 @@ do_select_codepage (void)
errmsg = errmsg =
init_translation_table (source_codepage, display_codepage); init_translation_table (source_codepage, display_codepage);
if (errmsg) { if (errmsg) {
message (1, MSG_ERROR, "%s", errmsg); message (D_ERROR, MSG_ERROR, "%s", errmsg);
return -1; return -1;
} }
} else { } else {
message (1, _("Warning"), message (D_ERROR, _("Warning"),
_("To use this feature select your codepage in\n" _("To use this feature select your codepage in\n"
"Setup / Display Bits dialog!\n" "Setup / Display Bits dialog!\n"
"Do not forget to save options.")); "Do not forget to save options."));

View File

@ -655,15 +655,15 @@ void resize_subshell (void)
int int
exit_subshell (void) exit_subshell (void)
{ {
int quit = TRUE; int subshell_quit = TRUE;
if (subshell_state != INACTIVE && subshell_alive) if (subshell_state != INACTIVE && subshell_alive)
quit = subshell_quit =
!query_dialog (_("Warning"), !query_dialog (_("Warning"),
_(" The shell is still active. Quit anyway? "), _(" The shell is still active. Quit anyway? "),
0, 2, _("&Yes"), _("&No")); D_NORMAL, 2, _("&Yes"), _("&No"));
if (quit) { if (subshell_quit) {
if (subshell_type == TCSH) { if (subshell_type == TCSH) {
if (unlink (tcsh_fifo) == -1) if (unlink (tcsh_fifo) == -1)
fprintf (stderr, "Cannot remove named pipe %s: %s\r\n", fprintf (stderr, "Cannot remove named pipe %s: %s\r\n",
@ -676,7 +676,7 @@ exit_subshell (void)
pty_buffer = NULL; pty_buffer = NULL;
} }
return quit; return subshell_quit;
} }

View File

@ -649,7 +649,7 @@ static void tree_move (WTree *tree, const char *default_dest)
return; return;
} }
if (stat (dest, &buf)){ if (stat (dest, &buf)){
message (1, MSG_ERROR, _(" Cannot stat the destination \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot stat the destination \n %s "),
unix_error_string (errno)); unix_error_string (errno));
g_free (dest); g_free (dest);
return; return;
@ -714,7 +714,7 @@ tree_rmdir_cmd (WTree *tree)
g_strdup_printf (_(" Delete %s? "), g_strdup_printf (_(" Delete %s? "),
tree->selected_ptr->name); tree->selected_ptr->name);
result = result =
query_dialog (_(" Delete "), buf, 3, 2, _("&Yes"), _("&No")); query_dialog (_(" Delete "), buf, D_ERROR, 2, _("&Yes"), _("&No"));
g_free (buf); g_free (buf);
if (result != 0) if (result != 0)
return; return;
@ -831,7 +831,7 @@ chdir_sel (WTree *tree)
if (do_cd (tree->selected_ptr->name, cd_exact)) { if (do_cd (tree->selected_ptr->name, cd_exact)) {
select_item (current_panel); select_item (current_panel);
} else { } else {
message (1, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "),
tree->selected_ptr->name, unix_error_string (errno)); tree->selected_ptr->name, unix_error_string (errno));
} }
change_panel (); change_panel ();

View File

@ -130,7 +130,7 @@ int check_format_var (const char *p, char **v)
return 0; return 0;
if (!dots || dots == q+5){ if (!dots || dots == q+5){
message (1, message (D_ERROR,
_(" Format error on file Extensions File "), _(" Format error on file Extensions File "),
!dots ? _(" The %%var macro has no default ") !dots ? _(" The %%var macro has no default ")
: _(" The %%var macro has no variable ")); : _(" The %%var macro has no variable "));
@ -463,7 +463,7 @@ debug_out (char *start, char *end, int cond)
len = strlen (msg); len = strlen (msg);
if (len) if (len)
msg [len - 1] = 0; msg [len - 1] = 0;
message (0, _(" Debug "), "%s", msg); message (D_NORMAL, _(" Debug "), "%s", msg);
} }
debug_flag = 0; debug_flag = 0;
@ -580,7 +580,7 @@ execute_menu_command (WEdit *edit_widget, const char *commands)
cmd_file_fd = mc_mkstemps (&file_name, "mcusr", SCRIPT_SUFFIX); cmd_file_fd = mc_mkstemps (&file_name, "mcusr", SCRIPT_SUFFIX);
if (cmd_file_fd == -1){ if (cmd_file_fd == -1){
message (1, MSG_ERROR, _(" Cannot create temporary command file \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot create temporary command file \n %s "),
unix_error_string (errno)); unix_error_string (errno));
return; return;
} }
@ -688,7 +688,7 @@ menu_file_own(char* path)
} }
if (verbose) if (verbose)
{ {
message (0, _(" Warning -- ignoring file "), message (D_NORMAL, _(" Warning -- ignoring file "),
_("File %s is not owned by root or you or is world writable.\n" _("File %s is not owned by root or you or is world writable.\n"
"Using it may compromise your security"), "Using it may compromise your security"),
path path
@ -712,7 +712,7 @@ user_menu_cmd (struct WEdit *edit_widget)
Listbox *listbox; Listbox *listbox;
if (!vfs_current_is_local ()){ if (!vfs_current_is_local ()){
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" Cannot execute commands on non-local filesystems")); _(" Cannot execute commands on non-local filesystems"));
return; return;
} }
@ -730,7 +730,7 @@ user_menu_cmd (struct WEdit *edit_widget)
} }
if ((data = load_file (menu)) == NULL){ if ((data = load_file (menu)) == NULL){
message (1, MSG_ERROR, _(" Cannot open file %s \n %s "), message (D_ERROR, MSG_ERROR, _(" Cannot open file %s \n %s "),
menu, unix_error_string (errno)); menu, unix_error_string (errno));
g_free (menu); g_free (menu);
menu = NULL; menu = NULL;
@ -811,7 +811,7 @@ user_menu_cmd (struct WEdit *edit_widget)
} }
if (menu_lines == 0) { if (menu_lines == 0) {
message (1, MSG_ERROR, _(" No suitable entries found in %s "), menu); message (D_ERROR, MSG_ERROR, _(" No suitable entries found in %s "), menu);
} else { } else {
max_cols = min (max (max_cols, col), MAX_ENTRY_LEN); max_cols = min (max (max_cols, col), MAX_ENTRY_LEN);

View File

@ -339,11 +339,11 @@ static int old_error; /* File descriptor of old standard error */
void open_error_pipe (void) void open_error_pipe (void)
{ {
if (pipe (error_pipe) < 0){ if (pipe (error_pipe) < 0){
message (0, _("Warning"), _(" Pipe failed ")); message (D_NORMAL, _("Warning"), _(" Pipe failed "));
} }
old_error = dup (2); old_error = dup (2);
if(old_error < 0 || close(2) || dup (error_pipe[1]) != 2){ if(old_error < 0 || close(2) || dup (error_pipe[1]) != 2){
message (0, _("Warning"), _(" Dup failed ")); message (D_NORMAL, _("Warning"), _(" Dup failed "));
close (error_pipe[0]); close (error_pipe[0]);
close (error_pipe[1]); close (error_pipe[1]);
} }

View File

@ -432,7 +432,7 @@ view_growbuf_read_until (WView *view, offset_type ofs)
view->growbuf_finished = TRUE; view->growbuf_finished = TRUE;
(void) pclose (view->ds_stdio_pipe); (void) pclose (view->ds_stdio_pipe);
display (view); display (view);
close_error_pipe (0, NULL); close_error_pipe (D_NORMAL, NULL);
view->ds_stdio_pipe = NULL; view->ds_stdio_pipe = NULL;
return; return;
} }
@ -690,7 +690,7 @@ view_close_datasource (WView *view)
if (view->ds_stdio_pipe != NULL) { if (view->ds_stdio_pipe != NULL) {
(void) pclose (view->ds_stdio_pipe); (void) pclose (view->ds_stdio_pipe);
display (view); display (view);
close_error_pipe (0, NULL); close_error_pipe (D_NORMAL, NULL);
view->ds_stdio_pipe = NULL; view->ds_stdio_pipe = NULL;
} }
view_growbuf_free (view); view_growbuf_free (view);
@ -1450,7 +1450,7 @@ view_show_error (WView *view, const char *msg)
if (view_is_in_panel (view)) { if (view_is_in_panel (view)) {
view_set_datasource_string (view, msg); view_set_datasource_string (view, msg);
} else { } else {
message (1, MSG_ERROR, "%s", msg); message (D_ERROR, MSG_ERROR, "%s", msg);
} }
} }
@ -1465,7 +1465,7 @@ view_load_command_output (WView *view, const char *command)
if ((fp = popen (command, "r")) == NULL) { if ((fp = popen (command, "r")) == NULL) {
/* Avoid two messages. Message from stderr has priority. */ /* Avoid two messages. Message from stderr has priority. */
display (view); display (view);
if (!close_error_pipe (view_is_in_panel (view) ? -1 : 1, NULL)) if (!close_error_pipe (view_is_in_panel (view) ? -1 : D_ERROR, NULL))
view_show_error (view, _(" Cannot spawn child process ")); view_show_error (view, _(" Cannot spawn child process "));
return FALSE; return FALSE;
} }
@ -1477,7 +1477,7 @@ view_load_command_output (WView *view, const char *command)
/* Avoid two messages. Message from stderr has priority. */ /* Avoid two messages. Message from stderr has priority. */
display (view); display (view);
if (!close_error_pipe (view_is_in_panel (view) ? -1 : 1, NULL)) if (!close_error_pipe (view_is_in_panel (view) ? -1 : D_ERROR, NULL))
view_show_error (view, _("Empty output from child filter")); view_show_error (view, _("Empty output from child filter"));
return FALSE; return FALSE;
} }
@ -2445,7 +2445,7 @@ search (WView *view, char *text,
destroy_dlg (d); destroy_dlg (d);
} }
if (!s) { if (!s) {
message (0, _("Search"), _(" Search string not found ")); message (D_NORMAL, _("Search"), _(" Search string not found "));
view->search_length = 0; view->search_length = 0;
} }
} }
@ -2596,7 +2596,7 @@ hex_search (WView *view, const char *text)
/* No valid bytes in the user input */ /* No valid bytes in the user input */
if (block_len <= 0 || parse_error) { if (block_len <= 0 || parse_error) {
message (0, _("Search"), _("Invalid hex search expression")); message (D_NORMAL, _("Search"), _("Invalid hex search expression"));
g_free (buffer); g_free (buffer);
view->search_length = 0; view->search_length = 0;
return; return;
@ -2608,7 +2608,7 @@ hex_search (WView *view, const char *text)
g_free (buffer); g_free (buffer);
if (pos == INVALID_OFFSET) { if (pos == INVALID_OFFSET) {
message (0, _("Search"), _(" Search string not found ")); message (D_NORMAL, _("Search"), _(" Search string not found "));
view->search_length = 0; view->search_length = 0;
return; return;
} }
@ -2648,7 +2648,7 @@ regexp_view_search (WView *view, char *pattern, char *string,
} }
flags |= REG_EXTENDED; flags |= REG_EXTENDED;
if (regcomp (&r, pattern, flags)) { if (regcomp (&r, pattern, flags)) {
message (1, MSG_ERROR, _(" Invalid regular expression ")); message (D_ERROR, MSG_ERROR, _(" Invalid regular expression "));
return -1; return -1;
} }
old_pattern = g_strdup (pattern); old_pattern = g_strdup (pattern);

View File

@ -157,7 +157,7 @@ cpio_open_cpio_file (struct vfs_class *me, struct vfs_s_super *super,
struct vfs_s_inode *root; struct vfs_s_inode *root;
if ((fd = mc_open (name, O_RDONLY)) == -1) { if ((fd = mc_open (name, O_RDONLY)) == -1) {
message (1, MSG_ERROR, _("Cannot open cpio archive\n%s"), name); message (D_ERROR, MSG_ERROR, _("Cannot open cpio archive\n%s"), name);
return -1; return -1;
} }
@ -173,7 +173,7 @@ cpio_open_cpio_file (struct vfs_class *me, struct vfs_s_super *super,
mc_close (fd); mc_close (fd);
s = g_strconcat (name, decompress_extension (type), (char *) NULL); s = g_strconcat (name, decompress_extension (type), (char *) NULL);
if ((fd = mc_open (s, O_RDONLY)) == -1) { if ((fd = mc_open (s, O_RDONLY)) == -1) {
message (1, MSG_ERROR, _("Cannot open cpio archive\n%s"), s); message (D_ERROR, MSG_ERROR, _("Cannot open cpio archive\n%s"), s);
g_free (s); g_free (s);
return -1; return -1;
} }
@ -239,7 +239,7 @@ static int cpio_find_head(struct vfs_class *me, struct vfs_s_super *super)
top = 128; top = 128;
} }
if((tmp = mc_read(super->u.arch.fd, buf, top)) == 0 || tmp == -1) { if((tmp = mc_read(super->u.arch.fd, buf, top)) == 0 || tmp == -1) {
message (1, MSG_ERROR, _("Premature end of cpio archive\n%s"), super->name); message (D_ERROR, MSG_ERROR, _("Premature end of cpio archive\n%s"), super->name);
cpio_free_archive(me, super); cpio_free_archive(me, super);
return CPIO_UNKNOWN; return CPIO_UNKNOWN;
} }
@ -284,7 +284,7 @@ static int cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *super)
g_assert(u.buf.c_magic == 070707); g_assert(u.buf.c_magic == 070707);
if (u.buf.c_namesize == 0 || u.buf.c_namesize > MC_MAXPATHLEN) { if (u.buf.c_namesize == 0 || u.buf.c_namesize > MC_MAXPATHLEN) {
message (1, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"), message (D_ERROR, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"),
super->name); super->name);
return STATUS_FAIL; return STATUS_FAIL;
} }
@ -336,13 +336,13 @@ static int cpio_read_oldc_head(struct vfs_class *me, struct vfs_s_super *super)
&hd.c_dev, &hd.c_ino, &hd.c_mode, &hd.c_uid, &hd.c_gid, &hd.c_dev, &hd.c_ino, &hd.c_mode, &hd.c_uid, &hd.c_gid,
&hd.c_nlink, &hd.c_rdev, &hd.c_mtime, &hd.c_nlink, &hd.c_rdev, &hd.c_mtime,
&hd.c_namesize, &hd.c_filesize) < 10) { &hd.c_namesize, &hd.c_filesize) < 10) {
message (1, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"), message (D_ERROR, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"),
super->name); super->name);
return STATUS_FAIL; return STATUS_FAIL;
} }
if (hd.c_namesize == 0 || hd.c_namesize > MC_MAXPATHLEN) { if (hd.c_namesize == 0 || hd.c_namesize > MC_MAXPATHLEN) {
message (1, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"), message (D_ERROR, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"),
super->name); super->name);
return STATUS_FAIL; return STATUS_FAIL;
} }
@ -396,7 +396,7 @@ static int cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *super)
&hd.c_nlink, &hd.c_mtime, &hd.c_filesize, &hd.c_nlink, &hd.c_mtime, &hd.c_filesize,
&hd.c_dev, &hd.c_devmin, &hd.c_rdev, &hd.c_rdevmin, &hd.c_dev, &hd.c_devmin, &hd.c_rdev, &hd.c_rdevmin,
&hd.c_namesize, &hd.c_chksum) < 14) { &hd.c_namesize, &hd.c_chksum) < 14) {
message (1, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"), message (D_ERROR, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"),
super->name); super->name);
return STATUS_FAIL; return STATUS_FAIL;
} }
@ -406,7 +406,7 @@ static int cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *super)
return STATUS_FAIL; return STATUS_FAIL;
if (hd.c_namesize == 0 || hd.c_namesize > MC_MAXPATHLEN) { if (hd.c_namesize == 0 || hd.c_namesize > MC_MAXPATHLEN) {
message (1, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"), message (D_ERROR, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"),
super->name); super->name);
return STATUS_FAIL; return STATUS_FAIL;
} }
@ -480,7 +480,7 @@ cpio_create_entry (struct vfs_class *me, struct vfs_s_super *super,
inode = l->inode; inode = l->inode;
if (inode->st.st_size && st->st_size if (inode->st.st_size && st->st_size
&& (inode->st.st_size != st->st_size)) { && (inode->st.st_size != st->st_size)) {
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_ _
("Inconsistent hardlinks of\n%s\nin cpio archive\n%s"), ("Inconsistent hardlinks of\n%s\nin cpio archive\n%s"),
name, super->name); name, super->name);
@ -507,7 +507,7 @@ cpio_create_entry (struct vfs_class *me, struct vfs_s_super *super,
'No such file or directory' is such case) */ 'No such file or directory' is such case) */
if (!S_ISDIR (entry->ino->st.st_mode)) { /* This can be considered archive inconsistency */ if (!S_ISDIR (entry->ino->st.st_mode)) { /* This can be considered archive inconsistency */
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_("%s contains duplicate entries! Skipping!"), _("%s contains duplicate entries! Skipping!"),
super->name); super->name);
} else { } else {
@ -579,7 +579,7 @@ cpio_open_archive (struct vfs_class *me, struct vfs_s_super *super,
switch (status) { switch (status) {
case STATUS_EOF: case STATUS_EOF:
message (1, MSG_ERROR, _("Unexpected end of file\n%s"), name); message (D_ERROR, MSG_ERROR, _("Unexpected end of file\n%s"), name);
return 0; return 0;
case STATUS_OK: case STATUS_OK:
continue; continue;

View File

@ -431,12 +431,12 @@ vfs_s_free_super (struct vfs_class *me, struct vfs_s_super *super)
#if 0 #if 0
/* FIXME: We currently leak small ammount of memory, sometimes. Fix it if you can. */ /* FIXME: We currently leak small ammount of memory, sometimes. Fix it if you can. */
if (super->ino_usage) if (super->ino_usage)
message (1, " Direntry warning ", message (D_ERROR, " Direntry warning ",
"Super ino_usage is %d, memory leak", "Super ino_usage is %d, memory leak",
super->ino_usage); super->ino_usage);
if (super->want_stale) if (super->want_stale)
message (1, " Direntry warning ", "Super has want_stale set"); message (D_ERROR, " Direntry warning ", "Super has want_stale set");
#endif #endif
if (super->prevp){ if (super->prevp){

View File

@ -256,7 +256,7 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc)
result = popen (cmd, "r"); result = popen (cmd, "r");
g_free (cmd); g_free (cmd);
if (result == NULL) { if (result == NULL) {
close_error_pipe (1, NULL); close_error_pipe (D_ERROR, NULL);
if (local_name) { if (local_name) {
mc_ungetlocalcopy (name, local_name, 0); mc_ungetlocalcopy (name, local_name, 0);
g_free(local_name); g_free(local_name);
@ -314,7 +314,7 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc)
if ((extfsd = if ((extfsd =
extfs_open_archive (fstype, name, &current_archive)) == NULL) { extfs_open_archive (fstype, name, &current_archive)) == NULL) {
message (1, MSG_ERROR, _("Cannot open %s archive\n%s"), message (D_ERROR, MSG_ERROR, _("Cannot open %s archive\n%s"),
extfs_prefixes[fstype], name); extfs_prefixes[fstype], name);
return -1; return -1;
} }
@ -354,7 +354,7 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc)
/* FIXME: Should clean everything one day */ /* FIXME: Should clean everything one day */
g_free (buffer); g_free (buffer);
pclose (extfsd); pclose (extfsd);
close_error_pipe (1, _("Inconsistent extfs archive")); close_error_pipe (D_ERROR, _("Inconsistent extfs archive"));
return -1; return -1;
} }
entry = g_new (struct entry, 1); entry = g_new (struct entry, 1);
@ -373,7 +373,7 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc)
/* FIXME: Should clean everything one day */ /* FIXME: Should clean everything one day */
g_free (buffer); g_free (buffer);
pclose (extfsd); pclose (extfsd);
close_error_pipe (1, close_error_pipe (D_ERROR,
_("Inconsistent extfs archive")); _("Inconsistent extfs archive"));
return -1; return -1;
} else { } else {
@ -425,11 +425,11 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc)
/* Check if extfs 'list' returned 0 */ /* Check if extfs 'list' returned 0 */
if (pclose (extfsd) != 0) { if (pclose (extfsd) != 0) {
extfs_free (current_archive); extfs_free (current_archive);
close_error_pipe (1, _("Inconsistent extfs archive")); close_error_pipe (D_ERROR, _("Inconsistent extfs archive"));
return -1; return -1;
} }
close_error_pipe (1, NULL); close_error_pipe (D_ERROR, NULL);
*pparc = current_archive; *pparc = current_archive;
return 0; return 0;
} }
@ -633,7 +633,7 @@ extfs_cmd (const char *extfs_cmd, struct archive *archive,
open_error_pipe (); open_error_pipe ();
retval = my_system (EXECUTE_AS_SHELL, shell, cmd); retval = my_system (EXECUTE_AS_SHELL, shell, cmd);
g_free (cmd); g_free (cmd);
close_error_pipe (1, NULL); close_error_pipe (D_ERROR, NULL);
return retval; return retval;
} }

View File

@ -239,7 +239,7 @@ fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
/* Currently, this does not work. ssh reads passwords from /* Currently, this does not work. ssh reads passwords from
/dev/tty, not from stdin :-(. */ /dev/tty, not from stdin :-(. */
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_ _
("Sorry, we cannot do password authenticated connections for now.")); ("Sorry, we cannot do password authenticated connections for now."));
ERRNOR (EPERM, -1); ERRNOR (EPERM, -1);

View File

@ -527,7 +527,7 @@ ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super,
goto login_fail; goto login_fail;
} }
} }
message (1, MSG_ERROR, _("ftpfs: Login incorrect for user %s "), message (D_ERROR, MSG_ERROR, _("ftpfs: Login incorrect for user %s "),
SUP.user); SUP.user);
login_fail: login_fail:
wipe_password (pass); wipe_password (pass);
@ -1786,7 +1786,7 @@ static int ftpfs_netrc_bad_mode (const char *netrcname)
if (stat (netrcname, &mystat) >= 0 && (mystat.st_mode & 077)) { if (stat (netrcname, &mystat) >= 0 && (mystat.st_mode & 077)) {
if (be_angry) { if (be_angry) {
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_("~/.netrc file has incorrect mode.\n" _("~/.netrc file has incorrect mode.\n"
"Remove password or correct mode.")); "Remove password or correct mode."));
be_angry = 0; be_angry = 0;

View File

@ -130,7 +130,7 @@ mcfs_login_server (int my_socket, char *user, int port,
return 0; return 0;
if (result != MC_VERSION_OK) { if (result != MC_VERSION_OK) {
message (1, _(" MCFS "), message (D_ERROR, _(" MCFS "),
_(" The server does not support this version ")); _(" The server does not support this version "));
close (my_socket); close (my_socket);
return 0; return 0;
@ -151,7 +151,7 @@ mcfs_login_server (int my_socket, char *user, int port,
(" The remote server is not running on a system port \n" (" The remote server is not running on a system port \n"
" you need a password to log in, but the information may \n" " you need a password to log in, but the information may \n"
" not be safe on the remote side. Continue? \n"), " not be safe on the remote side. Continue? \n"),
3, 2, _("&Yes"), _("&No")); D_ERROR, 2, _("&Yes"), _("&No"));
if (v == 1) { if (v == 1) {
close (my_socket); close (my_socket);
@ -175,7 +175,7 @@ mcfs_login_server (int my_socket, char *user, int port,
return 0; return 0;
if (result != MC_LOGINOK) { if (result != MC_LOGINOK) {
message (1, _(" MCFS "), _(" Invalid password ")); message (D_ERROR, _(" MCFS "), _(" Invalid password "));
rpc_send (my_socket, RPC_INT, MC_QUIT, RPC_END); rpc_send (my_socket, RPC_INT, MC_QUIT, RPC_END);
close (my_socket); close (my_socket);
return 0; return 0;
@ -235,7 +235,7 @@ mcfs_create_tcp_link (const char *host, int *port, int *version, const char *cal
sizeof (inaddr)); sizeof (inaddr));
else { else {
if ((hp = gethostbyname (host)) == NULL) { if ((hp = gethostbyname (host)) == NULL) {
message (1, caller, _(" Cannot locate hostname: %s "), message (D_ERROR, caller, _(" Cannot locate hostname: %s "),
host); host);
return 0; return 0;
} }
@ -254,13 +254,13 @@ mcfs_create_tcp_link (const char *host, int *port, int *version, const char *cal
server_address.sin_port = htons (*port); server_address.sin_port = htons (*port);
if ((my_socket = socket (AF_INET, SOCK_STREAM, 0)) < 0) { if ((my_socket = socket (AF_INET, SOCK_STREAM, 0)) < 0) {
message (1, caller, _(" Cannot create socket: %s "), message (D_ERROR, caller, _(" Cannot create socket: %s "),
unix_error_string (errno)); unix_error_string (errno));
return 0; return 0;
} }
if (connect (my_socket, (struct sockaddr *) &server_address, if (connect (my_socket, (struct sockaddr *) &server_address,
sizeof (server_address)) < 0) { sizeof (server_address)) < 0) {
message (1, caller, _(" Cannot connect to server: %s "), message (D_ERROR, caller, _(" Cannot connect to server: %s "),
unix_error_string (errno)); unix_error_string (errno));
close (my_socket); close (my_socket);
return 0; return 0;
@ -330,7 +330,7 @@ mcfs_open_link (char *host, char *user, int *port, char *netrcpass)
return &mcfs_connections[i]; return &mcfs_connections[i];
} }
if (mcfs_open_connections == MCFS_MAX_CONNECTIONS) { if (mcfs_open_connections == MCFS_MAX_CONNECTIONS) {
message (1, MSG_ERROR, _(" Too many open connections ")); message (D_ERROR, MSG_ERROR, _(" Too many open connections "));
return 0; return 0;
} }

View File

@ -147,11 +147,11 @@ sfs_vfmake (struct vfs_class *me, const char *name, char *cache)
g_free (pqname); g_free (pqname);
open_error_pipe (); open_error_pipe ();
if (my_system (EXECUTE_AS_SHELL, "/bin/sh", pad)) { if (my_system (EXECUTE_AS_SHELL, "/bin/sh", pad)) {
close_error_pipe (1, NULL); close_error_pipe (D_ERROR, NULL);
return -1; return -1;
} }
close_error_pipe (0, NULL); close_error_pipe (D_NORMAL, NULL);
return 0; /* OK */ return 0; /* OK */
} }

View File

@ -604,7 +604,7 @@ smbfs_reconnect(smbfs_connection *conn, int *retries)
cli_shutdown(conn->cli); cli_shutdown(conn->cli);
if (!(conn->cli = smbfs_do_connect(host, conn->service))) { if (!(conn->cli = smbfs_do_connect(host, conn->service))) {
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_(" reconnect to %s failed\n "), conn->host); _(" reconnect to %s failed\n "), conn->host);
g_free(host); g_free(host);
return False; return False;
@ -1162,7 +1162,7 @@ smbfs_open_link (char *host, char *path, const char *user, int *port,
if (my_errno != EPERM) if (my_errno != EPERM)
return 0; return 0;
message (1, MSG_ERROR, _(" Authentication failed ")); message (D_ERROR, MSG_ERROR, _(" Authentication failed "));
/* authentication failed, try again */ /* authentication failed, try again */
smbfs_auth_remove (bucket->host, bucket->service); smbfs_auth_remove (bucket->host, bucket->service);
@ -1685,7 +1685,7 @@ smbfs_mkdir (struct vfs_class * me, const char *path, mode_t mode)
if (!cli_mkdir (sc->cli, cpath)) { if (!cli_mkdir (sc->cli, cpath)) {
my_errno = cli_error (sc->cli, NULL, &err, NULL); my_errno = cli_error (sc->cli, NULL, &err, NULL);
message (1, MSG_ERROR, _(" Error %s creating directory %s "), message (D_ERROR, MSG_ERROR, _(" Error %s creating directory %s "),
cli_errstr (sc->cli), CNV_LANG (cpath)); cli_errstr (sc->cli), CNV_LANG (cpath));
g_free (cpath); g_free (cpath);
return -1; return -1;
@ -1711,7 +1711,7 @@ smbfs_rmdir (struct vfs_class *me, const char *path)
if (!cli_rmdir(sc->cli, cpath)) { if (!cli_rmdir(sc->cli, cpath)) {
my_errno = cli_error(sc->cli, NULL, &err, NULL); my_errno = cli_error(sc->cli, NULL, &err, NULL);
message (1, MSG_ERROR, _(" Error %s removing directory %s "), message (D_ERROR, MSG_ERROR, _(" Error %s removing directory %s "),
cli_errstr(sc->cli), CNV_LANG(cpath)); cli_errstr(sc->cli), CNV_LANG(cpath));
g_free (cpath); g_free (cpath);
return -1; return -1;
@ -1813,7 +1813,7 @@ smbfs_open_readwrite (smbfs_handle *remote_handle, char *rname, int flags, int m
flags : O_RDONLY, DENY_NONE); flags : O_RDONLY, DENY_NONE);
#endif #endif
if (remote_handle->fnum == -1) { if (remote_handle->fnum == -1) {
message (1, MSG_ERROR, _(" %s opening remote file %s "), message (D_ERROR, MSG_ERROR, _(" %s opening remote file %s "),
cli_errstr (remote_handle->cli), CNV_LANG (rname)); cli_errstr (remote_handle->cli), CNV_LANG (rname));
DEBUG (1, ("smbfs_open(rname:%s) error:%s\n", DEBUG (1, ("smbfs_open(rname:%s) error:%s\n",
rname, cli_errstr (remote_handle->cli))); rname, cli_errstr (remote_handle->cli)));
@ -1829,7 +1829,7 @@ smbfs_open_readwrite (smbfs_handle *remote_handle, char *rname, int flags, int m
NULL) NULL)
&& !cli_getattrE (remote_handle->cli, remote_handle->fnum, && !cli_getattrE (remote_handle->cli, remote_handle->fnum,
&remote_handle->attr, &size, NULL, NULL, NULL)) { &remote_handle->attr, &size, NULL, NULL, NULL)) {
message (1, MSG_ERROR, " getattrib: %s ", message (D_ERROR, MSG_ERROR, " getattrib: %s ",
cli_errstr (remote_handle->cli)); cli_errstr (remote_handle->cli));
DEBUG (1, DEBUG (1,
("smbfs_open(rname:%s) getattrib:%s\n", rname, ("smbfs_open(rname:%s) getattrib:%s\n", rname,
@ -1892,7 +1892,7 @@ smbfs_unlink (struct vfs_class *me, const char *path)
remote_file = free_after(smbfs_convert_path (remote_file, FALSE), remote_file); remote_file = free_after(smbfs_convert_path (remote_file, FALSE), remote_file);
if (!cli_unlink(sc->cli, remote_file)) { if (!cli_unlink(sc->cli, remote_file)) {
message (1, MSG_ERROR, _(" %s removing remote file %s "), message (D_ERROR, MSG_ERROR, _(" %s removing remote file %s "),
cli_errstr(sc->cli), CNV_LANG(remote_file)); cli_errstr(sc->cli), CNV_LANG(remote_file));
g_free (remote_file); g_free (remote_file);
return -1; return -1;
@ -1927,7 +1927,7 @@ smbfs_rename (struct vfs_class *me, const char *a, const char *b)
g_free (rb); g_free (rb);
if (!retval) { if (!retval) {
message (1, MSG_ERROR, _(" %s renaming files\n"), message (D_ERROR, MSG_ERROR, _(" %s renaming files\n"),
cli_errstr(sc->cli)); cli_errstr(sc->cli));
return -1; return -1;
} }

View File

@ -223,7 +223,7 @@ tar_open_archive_int (struct vfs_class *me, const char *name,
result = mc_open (name, O_RDONLY); result = mc_open (name, O_RDONLY);
if (result == -1) { if (result == -1) {
message (1, MSG_ERROR, _("Cannot open tar archive\n%s"), name); message (D_ERROR, MSG_ERROR, _("Cannot open tar archive\n%s"), name);
ERRNOR (ENOENT, -1); ERRNOR (ENOENT, -1);
} }
@ -241,7 +241,7 @@ tar_open_archive_int (struct vfs_class *me, const char *name,
s = g_strconcat (archive->name, decompress_extension (type), (char *) NULL); s = g_strconcat (archive->name, decompress_extension (type), (char *) NULL);
result = mc_open (s, O_RDONLY); result = mc_open (s, O_RDONLY);
if (result == -1) if (result == -1)
message (1, MSG_ERROR, _("Cannot open tar archive\n%s"), s); message (D_ERROR, MSG_ERROR, _("Cannot open tar archive\n%s"), s);
g_free (s); g_free (s);
if (result == -1) if (result == -1)
ERRNOR (ENOENT, -1); ERRNOR (ENOENT, -1);
@ -483,7 +483,7 @@ tar_read_header (struct vfs_class *me, struct vfs_s_super *archive,
archive->u.arch.type = TAR_GNU; archive->u.arch.type = TAR_GNU;
if (*h_size > MC_MAXPATHLEN) { if (*h_size > MC_MAXPATHLEN) {
message (1, MSG_ERROR, _("Inconsistent tar archive")); message (D_ERROR, MSG_ERROR, _("Inconsistent tar archive"));
return STATUS_BADCHECKSUM; return STATUS_BADCHECKSUM;
} }
@ -498,7 +498,7 @@ tar_read_header (struct vfs_class *me, struct vfs_s_super *archive,
if (data == NULL) { if (data == NULL) {
g_free (*longp); g_free (*longp);
*longp = NULL; *longp = NULL;
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_("Unexpected EOF on archive file")); _("Unexpected EOF on archive file"));
return STATUS_BADCHECKSUM; return STATUS_BADCHECKSUM;
} }
@ -513,7 +513,7 @@ tar_read_header (struct vfs_class *me, struct vfs_s_super *archive,
if (bp - *longp == MC_MAXPATHLEN && bp[-1] != '\0') { if (bp - *longp == MC_MAXPATHLEN && bp[-1] != '\0') {
g_free (*longp); g_free (*longp);
*longp = NULL; *longp = NULL;
message (1, MSG_ERROR, _("Inconsistent tar archive")); message (D_ERROR, MSG_ERROR, _("Inconsistent tar archive"));
return STATUS_BADCHECKSUM; return STATUS_BADCHECKSUM;
} }
*bp = 0; *bp = 0;
@ -588,7 +588,7 @@ tar_read_header (struct vfs_class *me, struct vfs_s_super *archive,
parent = parent =
vfs_s_find_inode (me, archive, q, LINK_NO_FOLLOW, FL_MKDIR); vfs_s_find_inode (me, archive, q, LINK_NO_FOLLOW, FL_MKDIR);
if (parent == NULL) { if (parent == NULL) {
message (1, MSG_ERROR, _("Inconsistent tar archive")); message (D_ERROR, MSG_ERROR, _("Inconsistent tar archive"));
return STATUS_BADCHECKSUM; return STATUS_BADCHECKSUM;
} }
@ -597,7 +597,7 @@ tar_read_header (struct vfs_class *me, struct vfs_s_super *archive,
vfs_s_find_inode (me, archive, current_link_name, vfs_s_find_inode (me, archive, current_link_name,
LINK_NO_FOLLOW, 0); LINK_NO_FOLLOW, 0);
if (inode == NULL) { if (inode == NULL) {
message (1, MSG_ERROR, _("Inconsistent tar archive")); message (D_ERROR, MSG_ERROR, _("Inconsistent tar archive"));
} else { } else {
entry = vfs_s_new_entry (me, p, inode); entry = vfs_s_new_entry (me, p, inode);
vfs_s_insert_entry (me, parent, entry); vfs_s_insert_entry (me, parent, entry);
@ -678,7 +678,7 @@ tar_open_archive (struct vfs_class *me, struct vfs_s_super *archive,
/* Error on first record */ /* Error on first record */
case STATUS_EOFMARK: case STATUS_EOFMARK:
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_ _
("Hmm,...\n%s\ndoesn't look like a tar archive."), ("Hmm,...\n%s\ndoesn't look like a tar archive."),
name); name);

View File

@ -188,20 +188,20 @@ undelfs_loaddel (void)
num_delarray = 0; num_delarray = 0;
delarray = g_try_malloc (sizeof (struct deleted_info) * max_delarray); delarray = g_try_malloc (sizeof (struct deleted_info) * max_delarray);
if (!delarray) { if (!delarray) {
message (1, undelfserr, _(" not enough memory ")); message (D_ERROR, undelfserr, _(" not enough memory "));
return 0; return 0;
} }
block_buf = g_try_malloc (fs->blocksize * 3); block_buf = g_try_malloc (fs->blocksize * 3);
if (!block_buf) { if (!block_buf) {
message (1, undelfserr, _(" while allocating block buffer ")); message (D_ERROR, undelfserr, _(" while allocating block buffer "));
goto free_delarray; goto free_delarray;
} }
if ((retval = ext2fs_open_inode_scan (fs, 0, &scan))) { if ((retval = ext2fs_open_inode_scan (fs, 0, &scan))) {
message (1, undelfserr, _(" open_inode_scan: %d "), retval); message (D_ERROR, undelfserr, _(" open_inode_scan: %d "), retval);
goto free_block_buf; goto free_block_buf;
} }
if ((retval = ext2fs_get_next_inode (scan, &ino, &inode))) { if ((retval = ext2fs_get_next_inode (scan, &ino, &inode))) {
message (1, undelfserr, _(" while starting inode scan %d "), message (D_ERROR, undelfserr, _(" while starting inode scan %d "),
retval); retval);
goto error_out; goto error_out;
} }
@ -227,7 +227,7 @@ undelfs_loaddel (void)
ext2fs_block_iterate (fs, ino, 0, block_buf, ext2fs_block_iterate (fs, ino, 0, block_buf,
undelfs_lsdel_proc, &lsd); undelfs_lsdel_proc, &lsd);
if (retval) { if (retval) {
message (1, undelfserr, message (D_ERROR, undelfserr,
_(" while calling ext2_block_iterate %d "), retval); _(" while calling ext2_block_iterate %d "), retval);
goto next; goto next;
} }
@ -238,7 +238,7 @@ undelfs_loaddel (void)
sizeof (struct deleted_info) * sizeof (struct deleted_info) *
(max_delarray + 50)); (max_delarray + 50));
if (!delarray_new) { if (!delarray_new) {
message (1, undelfserr, message (D_ERROR, undelfserr,
_ _
(" no more memory while reallocating array ")); (" no more memory while reallocating array "));
goto error_out; goto error_out;
@ -261,7 +261,7 @@ undelfs_loaddel (void)
next: next:
retval = ext2fs_get_next_inode (scan, &ino, &inode); retval = ext2fs_get_next_inode (scan, &ino, &inode);
if (retval) { if (retval) {
message (1, undelfserr, _(" while doing inode scan %d "), message (D_ERROR, undelfserr, _(" while doing inode scan %d "),
retval); retval);
goto error_out; goto error_out;
} }
@ -296,7 +296,7 @@ com_err (const char *whoami, long err_code, const char *fmt, ...)
str = g_strdup_vprintf (fmt, ap); str = g_strdup_vprintf (fmt, ap);
va_end (ap); va_end (ap);
message (1, _(" Ext2lib error "), " %s (%s: %ld) ", str, whoami, message (D_ERROR, _(" Ext2lib error "), " %s (%s: %ld) ", str, whoami,
err_code); err_code);
g_free (str); g_free (str);
} }
@ -324,18 +324,18 @@ undelfs_opendir (struct vfs_class *me, const char *dirname)
} }
if (ext2fs_open (ext2_fname, 0, 0, 0, unix_io_manager, &fs)){ if (ext2fs_open (ext2_fname, 0, 0, 0, unix_io_manager, &fs)){
message (1, undelfserr, _(" Cannot open file %s "), ext2_fname); message (D_ERROR, undelfserr, _(" Cannot open file %s "), ext2_fname);
return 0; return 0;
} }
print_vfs_message (_("undelfs: reading inode bitmap...")); print_vfs_message (_("undelfs: reading inode bitmap..."));
if (ext2fs_read_inode_bitmap (fs)){ if (ext2fs_read_inode_bitmap (fs)){
message (1, undelfserr, message (D_ERROR, undelfserr,
_(" Cannot load inode bitmap from: \n %s \n"), ext2_fname); _(" Cannot load inode bitmap from: \n %s \n"), ext2_fname);
goto quit_opendir; goto quit_opendir;
} }
print_vfs_message (_("undelfs: reading block bitmap...")); print_vfs_message (_("undelfs: reading block bitmap..."));
if (ext2fs_read_block_bitmap (fs)){ if (ext2fs_read_block_bitmap (fs)){
message (1, undelfserr, message (D_ERROR, undelfserr,
_(" Cannot load block bitmap from: \n %s \n"), ext2_fname); _(" Cannot load block bitmap from: \n %s \n"), ext2_fname);
goto quit_opendir; goto quit_opendir;
} }
@ -359,7 +359,7 @@ undelfs_readdir(void *vfs_info)
static char *const dirent_dest = undelfs_readdir_data.dent.d_name; static char *const dirent_dest = undelfs_readdir_data.dent.d_name;
if (vfs_info != fs) { if (vfs_info != fs) {
message (1, undelfserr, _(" vfs_info is not fs! ")); message (D_ERROR, undelfserr, _(" vfs_info is not fs! "));
return NULL; return NULL;
} }
if (readdir_ptr == num_delarray) if (readdir_ptr == num_delarray)
@ -413,7 +413,7 @@ undelfs_open (struct vfs_class *me, const char *fname, int flags, int mode)
return 0; return 0;
if (!ext2_fname || strcmp (ext2_fname, file)) { if (!ext2_fname || strcmp (ext2_fname, file)) {
message (1, undelfserr, message (D_ERROR, undelfserr,
_(" You have to chdir to extract files first ")); _(" You have to chdir to extract files first "));
g_free (file); g_free (file);
g_free (f); g_free (f);
@ -537,7 +537,7 @@ undelfs_read (void *vfs_info, char *buffer, int count)
retval = ext2fs_block_iterate(fs, p->inode, 0, NULL, retval = ext2fs_block_iterate(fs, p->inode, 0, NULL,
undelfs_dump_read, p); undelfs_dump_read, p);
if (retval){ if (retval){
message (1, undelfserr, _(" while iterating over blocks ")); message (D_ERROR, undelfserr, _(" while iterating over blocks "));
return -1; return -1;
} }
if (p->error_code && !p->finished) if (p->error_code && !p->finished)
@ -598,7 +598,7 @@ undelfs_lstat (struct vfs_class *me, const char *path, struct stat *buf)
} }
if (!ext2_fname || strcmp (ext2_fname, file)){ if (!ext2_fname || strcmp (ext2_fname, file)){
message (1, undelfserr, _(" You have to chdir to extract files first ")); message (D_ERROR, undelfserr, _(" You have to chdir to extract files first "));
g_free (file); g_free (file);
g_free (f); g_free (f);
return 0; return 0;
@ -637,7 +637,7 @@ undelfs_chdir(struct vfs_class *me, const char *path)
/* this could be fixed by making an ext2fs io manager to use */ /* this could be fixed by making an ext2fs io manager to use */
/* our vfs, but that is left as an excercise for the reader */ /* our vfs, but that is left as an excercise for the reader */
if ((fd = open (file, O_RDONLY)) == -1){ if ((fd = open (file, O_RDONLY)) == -1){
message (1, undelfserr, _(" Cannot open file %s "), file); message (D_ERROR, undelfserr, _(" Cannot open file %s "), file);
g_free (f); g_free (f);
g_free (file); g_free (file);
return -1; return -1;

View File

@ -818,10 +818,10 @@ vfs_parse_ls_lga (const char *p, struct stat *s, char **filename,
static int errorcount = 0; static int errorcount = 0;
if (++errorcount < 5) { if (++errorcount < 5) {
message (1, _("Cannot parse:"), "%s", message (D_ERROR, _("Cannot parse:"), "%s",
(p_copy && *p_copy) ? p_copy : line); (p_copy && *p_copy) ? p_copy : line);
} else if (errorcount == 5) } else if (errorcount == 5)
message (1, MSG_ERROR, message (D_ERROR, MSG_ERROR,
_("More parsing errors will be ignored.")); _("More parsing errors will be ignored."));
} }
@ -832,7 +832,7 @@ vfs_parse_ls_lga (const char *p, struct stat *s, char **filename,
void void
vfs_die (const char *m) vfs_die (const char *m)
{ {
message (1, _("Internal error:"), "%s", m); message (D_ERROR, _("Internal error:"), "%s", m);
exit (1); exit (1);
} }

View File

@ -841,7 +841,7 @@ mc_def_ungetlocalcopy (struct vfs_class *vfs, const char *filename,
return 0; return 0;
failed: failed:
message (1, _("Changes to file lost"), "%s", filename); message (D_ERROR, _("Changes to file lost"), "%s", filename);
if (fdout != -1) if (fdout != -1)
mc_close (fdout); mc_close (fdout);
if (fdin != -1) if (fdin != -1)