updated: [d84586b] Reverted the use of mhl_str_dup and use g_strdup instead.



The following commit has been merged in the master branch:
commit d84586ba82cf46f43ec02e1c12419ae518cbf37a
Author: Patrick Winnertz <winnie debian org>
Date:   Thu Feb 5 23:40:32 2009 +0100

    Reverted the use of mhl_str_dup and use g_strdup instead.
    
    Signed-off-by: Patrick Winnertz <winnie debian org>

diff --git a/edit/choosesyntax.c b/edit/choosesyntax.c
index 5715ac9..f4137e3 100644
--- a/edit/choosesyntax.c
+++ b/edit/choosesyntax.c
@@ -81,7 +81,7 @@ edit_syntax_dialog (void) {
     }
 
     old_auto_syntax = option_auto_syntax;
-    old_syntax_type = mhl_str_dup (option_syntax_type);
+    old_syntax_type = g_strdup (option_syntax_type);
 
     switch (syntax) {
 	case 0: /* auto syntax */
@@ -93,7 +93,7 @@ edit_syntax_dialog (void) {
 	default:
 	    option_auto_syntax = 0;
 	    g_free (option_syntax_type);
-	    option_syntax_type = mhl_str_dup (names[syntax - N_DFLT_ENTRIES]);
+	    option_syntax_type = g_strdup (names[syntax - N_DFLT_ENTRIES]);
     }
 
     /* Load or unload syntax rules if the option has changed */
diff --git a/edit/editcmd.c b/edit/editcmd.c
index 3a14b86..60bced2 100644
--- a/edit/editcmd.c
+++ b/edit/editcmd.c
@@ -294,7 +294,7 @@ edit_save_file (WEdit *edit, const char *filename)
 	 */
 	close (fd);
     } else
-	savename = mhl_str_dup (filename);
+	savename = g_strdup (filename);
 
     mc_chown (savename, edit->stat1.st_uid, edit->stat1.st_gid);
     mc_chmod (savename, edit->stat1.st_mode);
@@ -483,10 +483,10 @@ edit_set_filename (WEdit *edit, const char *f)
     g_free (edit->filename);
     if (!f)
 	f = "";
-    edit->filename = mhl_str_dup (f);
+    edit->filename = g_strdup (f);
     if (edit->dir == NULL && *f != PATH_SEP)
 #ifdef USE_VFS
-	edit->dir = mhl_str_dup (vfs_get_current_dir ());
+	edit->dir = g_strdup (vfs_get_current_dir ());
 #else
 	edit->dir = g_get_current_dir ();
 #endif
@@ -857,7 +857,7 @@ static int
 edit_load_file_from_filename (WEdit * edit, char *exp)
 {
     int prev_locked = edit->locked;
-    char *prev_filename = mhl_str_dup (edit->filename);
+    char *prev_filename = g_strdup (edit->filename);
 
     if (!edit_reload (edit, exp)) {
 	g_free (prev_filename);
@@ -1438,7 +1438,7 @@ string_regexp_search (char *pattern, char *string, int match_type,
 	    *found_len = 0;
 	    return -3;
 	}
-	old_pattern = mhl_str_dup (pattern);
+	old_pattern = g_strdup (pattern);
 	old_type = match_type;
 	old_icase = icase;
     }
@@ -1820,13 +1820,13 @@ edit_replace_cmd (WEdit *edit, int again)
 	again = 0;
 
     if (again) {
-	input1 = mhl_str_dup (saved1 ? saved1 : "");
-	input2 = mhl_str_dup (saved2 ? saved2 : "");
-	input3 = mhl_str_dup (saved3 ? saved3 : "");
+	input1 = g_strdup (saved1 ? saved1 : "");
+	input2 = g_strdup (saved2 ? saved2 : "");
+	input3 = g_strdup (saved3 ? saved3 : "");
     } else {
-	char *disp1 = mhl_str_dup (saved1 ? saved1 : "");
-	char *disp2 = mhl_str_dup (saved2 ? saved2 : "");
-	char *disp3 = mhl_str_dup (saved3 ? saved3 : "");
+	char *disp1 = g_strdup (saved1 ? saved1 : "");
+	char *disp2 = g_strdup (saved2 ? saved2 : "");
+	char *disp3 = g_strdup (saved3 ? saved3 : "");
 
 	convert_to_display (disp1);
 	convert_to_display (disp2);
@@ -2066,7 +2066,7 @@ void edit_search_cmd (WEdit * edit, int again)
     if (again) {		/*ctrl-hotkey for search again. */
 	if (!old)
 	    return;
-	exp = mhl_str_dup (old);
+	exp = g_strdup (old);
     } else {
 
 #ifdef HAVE_CHARSET
@@ -2088,7 +2088,7 @@ void edit_search_cmd (WEdit * edit, int again)
 	if (*exp) {
 	    int len = 0;
 	    g_free (old);
-	    old = mhl_str_dup (exp);
+	    old = g_strdup (exp);
 
 	    if (search_create_bookmark) {
 		int found = 0, books = 0;
diff --git a/edit/editlock.c b/edit/editlock.c
index 2f83a2b..a33b1d6 100644
--- a/edit/editlock.c
+++ b/edit/editlock.c
@@ -98,7 +98,7 @@ lock_build_symlink_name (const char *fname)
 	return NULL;
 
     fname = x_basename (absolute_fname);
-    fname_copy = mhl_str_dup (fname);
+    fname_copy = g_strdup (fname);
     absolute_fname[fname - absolute_fname] = '\0';
     symlink_name = g_strconcat (absolute_fname, ".#", fname_copy, (char *) NULL);
     g_free (fname_copy);
diff --git a/edit/syntax.c b/edit/syntax.c
index 282a700..8fdea33 100644
--- a/edit/syntax.c
+++ b/edit/syntax.c
@@ -773,8 +773,8 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args, int args_size)
 		}
 		a++;
 		c = r[0] = g_malloc0 (sizeof (struct context_rule));
-		c->left = mhl_str_dup (" ");
-		c->right = mhl_str_dup (" ");
+		c->left = g_strdup (" ");
+		c->right = g_strdup (" ");
 		num_contexts = 0;
 	    } else {
 		/* Terminate previous context.  */
@@ -787,14 +787,14 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args, int args_size)
 		check_a;
 		if (!strcmp (*a, "whole")) {
 		    a++;
-		    c->whole_word_chars_left = mhl_str_dup (whole_left);
-		    c->whole_word_chars_right = mhl_str_dup (whole_right);
+		    c->whole_word_chars_left = g_strdup (whole_left);
+		    c->whole_word_chars_right = g_strdup (whole_right);
 		} else if (!strcmp (*a, "wholeleft")) {
 		    a++;
-		    c->whole_word_chars_left = mhl_str_dup (whole_left);
+		    c->whole_word_chars_left = g_strdup (whole_left);
 		} else if (!strcmp (*a, "wholeright")) {
 		    a++;
-		    c->whole_word_chars_right = mhl_str_dup (whole_right);
+		    c->whole_word_chars_right = g_strdup (whole_right);
 		}
 		check_a;
 		if (!strcmp (*a, "linestart")) {
@@ -802,14 +802,14 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args, int args_size)
 		    c->line_start_left = 1;
 		}
 		check_a;
-		c->left = mhl_str_dup (*a++);
+		c->left = g_strdup (*a++);
 		check_a;
 		if (!strcmp (*a, "linestart")) {
 		    a++;
 		    c->line_start_right = 1;
 		}
 		check_a;
-		c->right = mhl_str_dup (*a++);
+		c->right = g_strdup (*a++);
 		c->first_left = *c->left;
 		c->first_right = *c->right;
 	    }
@@ -826,7 +826,7 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args, int args_size)
 	    g_strlcpy (last_fg, fg ? fg : "", sizeof (last_fg));
 	    g_strlcpy (last_bg, bg ? bg : "", sizeof (last_bg));
 	    c->keyword[0]->color = this_try_alloc_color_pair (fg, bg);
-	    c->keyword[0]->keyword = mhl_str_dup (" ");
+	    c->keyword[0]->keyword = g_strdup (" ");
 	    check_not_a;
 
 	    alloc_words_per_context = MAX_WORDS_PER_CONTEXT;
@@ -852,14 +852,14 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args, int args_size)
 	    k = r[num_contexts - 1]->keyword[num_words] = g_malloc0 (sizeof (struct key_word));
 	    if (!strcmp (*a, "whole")) {
 		a++;
-		k->whole_word_chars_left = mhl_str_dup (whole_left);
-		k->whole_word_chars_right = mhl_str_dup (whole_right);
+		k->whole_word_chars_left = g_strdup (whole_left);
+		k->whole_word_chars_right = g_strdup (whole_right);
 	    } else if (!strcmp (*a, "wholeleft")) {
 		a++;
-		k->whole_word_chars_left = mhl_str_dup (whole_left);
+		k->whole_word_chars_left = g_strdup (whole_left);
 	    } else if (!strcmp (*a, "wholeright")) {
 		a++;
-		k->whole_word_chars_right = mhl_str_dup (whole_right);
+		k->whole_word_chars_right = g_strdup (whole_right);
 	    }
 	    check_a;
 	    if (!strcmp (*a, "linestart")) {
@@ -870,7 +870,7 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args, int args_size)
 	    if (!strcmp (*a, "whole")) {
 		break_a;
 	    }
-	    k->keyword = mhl_str_dup (*a++);
+	    k->keyword = g_strdup (*a++);
 	    k->first = *k->keyword;
 	    subst_defines (edit->defines, a, &args[1024]);
 	    fg = *a;
@@ -910,12 +910,12 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args, int args_size)
 	    if ((argv = g_tree_lookup (edit->defines, key))) {
 		mc_defines_destroy (NULL, argv, NULL);
 	    } else {
-		key = mhl_str_dup (key);
+		key = g_strdup (key);
 	    }
 	    argv = g_new (char *, argc - 1);
 	    g_tree_insert (edit->defines, key, argv);
 	    while (*a) {
-		*argv++ = mhl_str_dup (*a++);
+		*argv++ = g_strdup (*a++);
 	    };
 	    *argv = NULL;
 	} else {		/* anything else is an error */
@@ -955,7 +955,7 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args, int args_size)
 	    for (j = 1; c->keyword[j]; j++)
 		*p++ = c->keyword[j]->first;
 	    *p = '\0';
-	    c->keyword_first_chars = mhl_str_dup (first_chars);
+	    c->keyword_first_chars = g_strdup (first_chars);
 	}
 
 	g_free (first_chars);
@@ -1076,7 +1076,7 @@ edit_read_syntax_file (WEdit * edit, char ***pnames, const char *syntax_file,
 		else
 		    abort ();
 	    }
-	    (*pnames)[count++] = mhl_str_dup (args[2]);
+	    (*pnames)[count++] = g_strdup (args[2]);
 	    (*pnames)[count] = NULL;
 	} else if (type) {
 
diff --git a/edit/usermap.c b/edit/usermap.c
index c1beafd..fb06124 100644
--- a/edit/usermap.c
+++ b/edit/usermap.c
@@ -505,7 +505,7 @@ cmd_label(config_t *cfg, int argc, char *argv[])
     }
 
     keymap_add(cfg->keymap, KEY_F(fn), cmd->val);
-    cfg->labels[fn - 1] = mhl_str_dup(label);
+    cfg->labels[fn - 1] = g_strdup(label);
 
     return true;
 }
@@ -553,7 +553,7 @@ parse_file(config_t *cfg, const char *file, const command_t *cmd)
 	}
 
 	if (!(c->handler(cfg, args->len, argv))) {
-	    char *ss = mhl_str_dup(error_msg);
+	    char *ss = g_strdup(error_msg);
 	    snprintf(error_msg, sizeof(error_msg),
 			 _("%s:%d: %s"), file, line, ss);
 	    g_free(ss);
diff --git a/src/boxes.c b/src/boxes.c
index c0351f8..a2c863c 100644
--- a/src/boxes.c
+++ b/src/boxes.c
@@ -229,14 +229,14 @@ display_box (WPanel *panel, char **userp, char **minip, int *use_msformat, int n
         p = get_nth_panel_name (num);
         panel = g_new (WPanel, 1);
         panel->list_type = list_full;
-        panel->user_format = mhl_str_dup (DEFAULT_USER_FORMAT);
+        panel->user_format = g_strdup (DEFAULT_USER_FORMAT);
         panel->user_mini_status = 0;
 	for (i = 0; i < LIST_TYPES; i++)
-    	    panel->user_status_format[i] = mhl_str_dup (DEFAULT_USER_FORMAT);
+    	    panel->user_status_format[i] = g_strdup (DEFAULT_USER_FORMAT);
         section = g_strconcat ("Temporal:", p, (char *) NULL);
         if (!profile_has_section (section, profile_name)) {
             g_free (section);
-            section = mhl_str_dup (p);
+            section = g_strdup (p);
         }
         panel_load_setup (panel, section);
         g_free (section);
@@ -259,8 +259,8 @@ display_box (WPanel *panel, char **userp, char **minip, int *use_msformat, int n
     
     if (dd->ret_value != B_CANCEL){
 	result = my_radio->sel;
-	*userp = mhl_str_dup (user->buffer);
-	*minip = mhl_str_dup (status->buffer);
+	*userp = g_strdup (user->buffer);
+	*minip = g_strdup (status->buffer);
 	*use_msformat = check_status->state & C_BOOL;
     }
     destroy_dlg (dd);
@@ -693,7 +693,7 @@ tree_box (const char *current_dir)
     
     run_dlg (dlg);
     if (dlg->ret_value == B_ENTER)
-	val = mhl_str_dup (tree_selected_name (mytree));
+	val = g_strdup (tree_selected_name (mytree));
     else
 	val = 0;
     
@@ -1115,11 +1115,11 @@ vfs_smb_get_authinfo (const char *host, const char *share, const char *domain,
     default:
         return_value = g_new (struct smb_authinfo, 1);
         if (return_value) {
-            return_value->host = mhl_str_dup (host);
-            return_value->share = mhl_str_dup (share);
-            return_value->domain = mhl_str_dup (in_domain->buffer);
-            return_value->user = mhl_str_dup (in_user->buffer);
-            return_value->password = mhl_str_dup (in_password->buffer);
+            return_value->host = g_strdup (host);
+            return_value->share = g_strdup (share);
+            return_value->domain = g_strdup (in_domain->buffer);
+            return_value->user = g_strdup (in_user->buffer);
+            return_value->password = g_strdup (in_password->buffer);
         }
     }
 
diff --git a/src/charsets.c b/src/charsets.c
index cb45a52..4e807c0 100644
--- a/src/charsets.c
+++ b/src/charsets.c
@@ -88,12 +88,12 @@ load_codepages_list (void)
 	    goto fail;
 
 	if (strcmp (buf, "default") == 0) {
-	    default_codepage = mhl_str_dup (p);
+	    default_codepage = g_strdup (p);
 	    continue;
 	}
 
-	codepages[n_codepages].id = mhl_str_dup (buf);
-	codepages[n_codepages].name = mhl_str_dup (p);
+	codepages[n_codepages].id = g_strdup (buf);
+	codepages[n_codepages].name = g_strdup (p);
 	++n_codepages;
     }
 
diff --git a/src/cmd.c b/src/cmd.c
index 4f00f03..da9248f 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -372,7 +372,7 @@ mkdir_cmd (void)
 	return;
 
     if (dir[0] == '/' || dir[0] == '~')
-	absdir = mhl_str_dup (dir);
+	absdir = g_strdup (dir);
     else
 	absdir = mhl_str_dir_plus_file (current_panel->cwd, dir);
 
@@ -614,7 +614,7 @@ menu_edit_cmd (int where)
 
     switch (dir) {
 	case 0:
-	    buffer = mhl_str_dup (where ? CEDIT_LOCAL_MENU : MC_LOCAL_MENU);
+	    buffer = g_strdup (where ? CEDIT_LOCAL_MENU : MC_LOCAL_MENU);
 	    check_for_default (menufile, buffer);
 	    break;
 
@@ -937,7 +937,7 @@ do_link (int symbolic_link, const char *fname)
 	if (get_other_type () == view_listing) {
 	    d = mhl_str_dir_plus_file (other_panel->cwd, fname);
 	} else {
-	    d = mhl_str_dup (fname);
+	    d = g_strdup (fname);
 	}
 
 	symlink_dialog (s, d, &dest, &src);
@@ -1056,7 +1056,7 @@ char *guess_message_value (void)
     if (locale == NULL)
 	locale = "";
 
-    return mhl_str_dup (locale);
+    return g_strdup (locale);
 }
 
 /*
@@ -1074,7 +1074,7 @@ get_random_hint (int force)
     /* Do not change hints more often than one minute */
     gettimeofday (&tv, NULL);
     if (!force && !(tv.tv_sec > last_sec + 60))
-	return mhl_str_dup ("");
+	return g_strdup ("");
     last_sec = tv.tv_sec;
 
     data = load_mc_home_file (MC_HINT, NULL);
@@ -1095,7 +1095,7 @@ get_random_hint (int force)
     eol = strchr (&data[start], '\n');
     if (eol)
 	*eol = 0;
-    result = mhl_str_dup (&data[start]);
+    result = g_strdup (&data[start]);
     g_free (data);
     return result;
 }
diff --git a/src/color.c b/src/color.c
index 295159f..7d07760 100644
--- a/src/color.c
+++ b/src/color.c
@@ -229,7 +229,7 @@ static void configure_colors_string (const char *the_color_string)
     if (!the_color_string)
 	return;
 
-    p = color_string = mhl_str_dup (the_color_string);
+    p = color_string = g_strdup (the_color_string);
     while (color_string && *color_string){
 	while (*color_string == ' ' || *color_string == '\t')
 	    color_string++;
@@ -398,8 +398,8 @@ try_alloc_color_pair (const char *fg, const char *bg)
     p->next = g_new (struct colors_avail, 1);
     p = p->next;
     p->next = 0;
-    p->fg = fg ? mhl_str_dup (fg) : 0;
-    p->bg = bg ? mhl_str_dup (bg) : 0;
+    p->fg = fg ? g_strdup (fg) : 0;
+    p->bg = bg ? g_strdup (bg) : 0;
     if (!fg)
         /* Index in color_map array = COLOR_INDEX - 1 */
 	fg = color_map[EDITOR_NORMAL_COLOR_INDEX - 1].fg;
@@ -437,8 +437,8 @@ try_alloc_color_pair (const char *fg, const char *bg)
     p->next = g_new (struct colors_avail, 1);
     p = p->next;
     p->next = 0;
-    p->fg = fg ? mhl_str_dup (fg) : 0;
-    p->bg = bg ? mhl_str_dup (bg) : 0;
+    p->fg = fg ? g_strdup (fg) : 0;
+    p->bg = bg ? g_strdup (bg) : 0;
     if (!fg)
         /* Index in color_map array = COLOR_INDEX - 1 */
 	fg_index = color_map[EDITOR_NORMAL_COLOR_INDEX - 1].fg;
diff --git a/src/command.c b/src/command.c
index e720dc2..07f66dc 100644
--- a/src/command.c
+++ b/src/command.c
@@ -115,7 +115,7 @@ examine_cd (char *path)
 
     /* CDPATH handling */
     if (*q != PATH_SEP && !result) {
-	char * const cdpath = mhl_str_dup (getenv ("CDPATH"));
+	char * const cdpath = g_strdup (getenv ("CDPATH"));
 	char *p = cdpath;
 	if (p == NULL)
 	    c = 0;
@@ -186,7 +186,7 @@ void do_cd_command (char *cmd)
 	}
     } else
 	if (!examine_cd (&cmd [3])) {
-	    char *d = strip_password (mhl_str_dup (&cmd [3]), 1);
+	    char *d = strip_password (g_strdup (&cmd [3]), 1);
 	    message (D_ERROR, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "),
 		     d, unix_error_string (errno));
 	    g_free (d);
diff --git a/src/complete.c b/src/complete.c
index d5023cc..ed4dfcd 100644
--- a/src/complete.c
+++ b/src/complete.c
@@ -97,11 +97,11 @@ filename_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags)
         g_free (users_dirname);
 
 	if ((*text) && (temp = strrchr (text, PATH_SEP))){
-	    filename = mhl_str_dup (++temp);
+	    filename = g_strdup (++temp);
 	    dirname = g_strndup (text, temp - text);
 	} else {
-	    dirname = mhl_str_dup (".");
-	    filename = mhl_str_dup (text);
+	    dirname = g_strdup (".");
+	    filename = g_strdup (text);
 	}
 
         /* We aren't done yet.  We also support the "~user" syntax. */
@@ -472,7 +472,7 @@ command_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags)
 	    words = bash_reserved;
 	    phase = 0;
 	    text_len = strlen (text);
-	    if (!path && (path = mhl_str_dup (getenv ("PATH"))) != NULL) {
+	    if (!path && (path = g_strdup (getenv ("PATH"))) != NULL) {
 		p = path;
 		path_end = strchr (p, 0);
 		while ((p = strchr (p, PATH_ENV_SEP))) {
@@ -496,7 +496,7 @@ command_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags)
     case 0:			/* Reserved words */
 	while (*words) {
 	    if (!strncmp (*words, text, text_len))
-		return mhl_str_dup (*(words++));
+		return g_strdup (*(words++));
 	    words++;
 	}
 	phase++;
@@ -504,7 +504,7 @@ command_completion_function (char *text, int state, INPUT_COMPLETE_FLAGS flags)
     case 1:			/* Builtin commands */
 	while (*words) {
 	    if (!strncmp (*words, text, text_len))
-		return mhl_str_dup (*(words++));
+		return g_strdup (*(words++));
 	    words++;
 	}
 	phase++;
@@ -678,7 +678,7 @@ try_complete (char *text, int *start, int *end, INPUT_COMPLETE_FLAGS flags)
 
     c = text [*end];
     text [*end] = 0;
-    word = mhl_str_dup (text + *start);
+    word = g_strdup (text + *start);
     text [*end] = c;
 
     /* Determine if this could be a command word. It is if it appears at
@@ -799,7 +799,7 @@ try_complete (char *text, int *start, int *end, INPUT_COMPLETE_FLAGS flags)
 		    }
 		}
     	    if (p == q){
-		char * const cdpath_ref = mhl_str_dup (getenv ("CDPATH"));
+		char * const cdpath_ref = g_strdup (getenv ("CDPATH"));
 		char *cdpath = cdpath_ref;
 		char c, *s, *r;
 
diff --git a/src/dialog.c b/src/dialog.c
index 37c6903..7ef1eef 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -219,7 +219,7 @@ create_dlg (int y1, int x1, int lines, int cols, const int *color_set,
     /* Strip existing spaces, add one space before and after the title */
     if (title) {
 	char *t;
-	t = g_strstrip (mhl_str_dup (title));
+	t = g_strstrip (g_strdup (title));
 	new_d->title = g_strconcat (" ", t, " ", (char *) NULL);
 	g_free (t);
     }
diff --git a/src/dir.c b/src/dir.c
index 48aa586..bf732ba 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -275,7 +275,7 @@ add_dotdot_to_list (dir_list *list, int index)
 
     memset (&(list->list) [index], 0, sizeof(file_entry));
     (list->list) [index].fnamelen = 2;
-    (list->list) [index].fname = mhl_str_dup ("..");
+    (list->list) [index].fname = g_strdup ("..");
     (list->list) [index].f.link_to_dir = 0;
     (list->list) [index].f.stale_link = 0;
     (list->list) [index].f.dir_size_computed = 0;
@@ -422,7 +422,7 @@ do_load_dir (const char *path, dir_list *list, sortfn *sort, int reverse,
 	    return next_free;
 	}
 	list->list[next_free].fnamelen = NLENGTH (dp);
-	list->list[next_free].fname = mhl_str_dup (dp->d_name);
+	list->list[next_free].fname = g_strdup (dp->d_name);
 	list->list[next_free].f.marked = 0;
 	list->list[next_free].f.link_to_dir = link_to_dir;
 	list->list[next_free].f.stale_link = stale_link;
@@ -574,7 +574,7 @@ do_reload_dir (const char *path, dir_list *list, sortfn *sort, int count,
 	}
 
 	list->list[next_free].fnamelen = NLENGTH (dp);
-	list->list[next_free].fname = mhl_str_dup (dp->d_name);
+	list->list[next_free].fname = g_strdup (dp->d_name);
 	list->list[next_free].f.link_to_dir = link_to_dir;
 	list->list[next_free].f.stale_link = stale_link;
 	list->list[next_free].f.dir_size_computed = 0;
diff --git a/src/ecs.c b/src/ecs.c
index 3fa3da6..62683a6 100644
--- a/src/ecs.c
+++ b/src/ecs.c
@@ -56,7 +56,7 @@ extern bool ecs_mbstr_to_str(ecs_char **ret_str, const char *s)
 	*ret_str = g_renew(ecs_char, str, len + 1);
 	return TRUE;
 #else
-	*ret_str = mhl_str_dup(s);
+	*ret_str = g_strdup(s);
 	return TRUE;
 #endif
 }
@@ -80,7 +80,7 @@ extern bool ecs_str_to_mbstr(char **ret_str, const ecs_char *s)
 	*ret_str = g_renew(char, str, len + 1);
 	return TRUE;
 #else
-	*ret_str = mhl_str_dup(s);
+	*ret_str = g_strdup(s);
 	return TRUE;
 #endif
 }
diff --git a/src/execute.c b/src/execute.c
index c07c084..35b4d4b 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -102,7 +102,7 @@ do_execute (const char *shell, const char *command, int flags)
     char *old_vfs_dir = 0;
 
     if (!vfs_current_is_local ())
-	old_vfs_dir = mhl_str_dup (vfs_get_current_dir ());
+	old_vfs_dir = g_strdup (vfs_get_current_dir ());
 #endif				/* USE_VFS */
 
     save_cwds_stat ();
@@ -365,7 +365,7 @@ execute_with_vfs_arg (const char *command, const char *filename)
      * the command, so make a copy.  Smarter VFS code would make the code
      * below unnecessary.
      */
-    fn = mhl_str_dup (filename);
+    fn = g_strdup (filename);
     mc_stat (localcopy, &st);
     mtime = st.st_mtime;
     do_execute (command, localcopy, EXECUTE_INTERNAL);
diff --git a/src/ext.c b/src/ext.c
index ca63d06..8d7abef 100644
--- a/src/ext.c
+++ b/src/ext.c
@@ -592,7 +592,7 @@ regex_command (const char *filename, const char *action, int *move_dir)
 			 * we get filename as a pointer from current_panel->dir).
 			 */
 			if (p < q) {
-			    char *filename_copy = mhl_str_dup (filename);
+			    char *filename_copy = g_strdup (filename);
 
 			    exec_extension (filename_copy, r + 1, move_dir,
 					    view_at_line_number);
diff --git a/src/file.c b/src/file.c
index 0b0a503..2d78e05 100644
--- a/src/file.c
+++ b/src/file.c
@@ -45,6 +45,7 @@
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -245,7 +246,7 @@ do_transform_source (FileOpContext *ctx, const char *source)
 static const char *
 transform_source (FileOpContext *ctx, const char *source)
 {
-    char *s = mhl_str_dup (source);
+    char *s = g_strdup (source);
     char *q;
     const char *p;
 
@@ -392,7 +393,7 @@ make_symlink (FileOpContext *ctx, const char *src_path, const char *dst_path)
 	if (r) {
 	    p = g_strndup (src_path, r - src_path + 1);
 	    if (*dst_path == PATH_SEP)
-		q = mhl_str_dup (dst_path);
+		q = g_strdup (dst_path);
 	    else
 		q = g_strconcat (p, dst_path, (char *) NULL);
 	    s = strrchr (q, PATH_SEP);
@@ -902,7 +903,7 @@ copy_dir_dir (FileOpContext *ctx, const char *s, const char *d, int toplevel,
 		return FILE_CONT;
 	    }
 	}
-	dest_dir = mhl_str_dup (d);
+	dest_dir = g_strdup (d);
     } else {
 	/*
 	 * If the destination directory exists, we want to copy the whole
@@ -924,7 +925,7 @@ copy_dir_dir (FileOpContext *ctx, const char *s, const char *d, int toplevel,
 	if (toplevel && ctx->dive_into_subdirs) {
 	    dest_dir = mhl_str_dir_plus_file (d, x_basename (s));
 	} else {
-	    dest_dir = mhl_str_dup (d);
+	    dest_dir = g_strdup (d);
 	    goto dont_mkdir;
 	}
     }
@@ -1168,9 +1169,9 @@ move_dir_dir (FileOpContext *ctx, const char *s, const char *d,
 
     mc_stat (s, &sbuf);
     if (mc_stat (d, &dbuf))
-	destdir = mhl_str_dup (d);	/* destination doesn't exist */
+	destdir = g_strdup (d);	/* destination doesn't exist */
     else if (!ctx->dive_into_subdirs) {
-	destdir = mhl_str_dup (d);
+	destdir = g_strdup (d);
 	move_over = 1;
     } else
 	destdir = mhl_str_dir_plus_file (d, x_basename (s));
@@ -1862,11 +1863,11 @@ panel_operate (void *source_panel, FileOperation operation,
        invalid data. */
     if (dest) {
 	if (mc_setctl (dest, VFS_SETCTL_STALE_DATA, (void *) 1))
-	    save_dest = mhl_str_dup (dest);
+	    save_dest = g_strdup (dest);
     }
     if (panel->cwd) {
 	if (mc_setctl (panel->cwd, VFS_SETCTL_STALE_DATA, (void *) 1))
-	    save_cwd = mhl_str_dup (panel->cwd);
+	    save_cwd = g_strdup (panel->cwd);
     }
 
     /* Now, let's do the job */
diff --git a/src/filegui.c b/src/filegui.c
index 40ed226..c57dc79 100644
--- a/src/filegui.c
+++ b/src/filegui.c
@@ -883,7 +883,7 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, const char *text,
     fmd_widgets[FMCB21].result = &ctx->dive_into_subdirs;
 
     /* filter out a possible password from def_text */
-    def_text_secure = strip_password (mhl_str_dup (def_text), 1);
+    def_text_secure = strip_password (g_strdup (def_text), 1);
 
     /* Create the dialog */
 
@@ -973,14 +973,14 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, const char *text,
 	    && ((!only_one && !is_wildcarded (ctx->dest_mask))
 		|| (only_one && !mc_stat (dest_dir, &buf)
 		    && S_ISDIR (buf.st_mode)))))
-	ctx->dest_mask = mhl_str_dup ("*");
+	ctx->dest_mask = g_strdup ("*");
     else {
-	ctx->dest_mask = mhl_str_dup (ctx->dest_mask);
+	ctx->dest_mask = g_strdup (ctx->dest_mask);
 	*orig_mask = 0;
     }
     if (!*dest_dir) {
 	g_free (dest_dir);
-	dest_dir = mhl_str_dup ("./");
+	dest_dir = g_strdup ("./");
     }
     if (val == B_USER)
 	*do_background = 1;
diff --git a/src/filenot.c b/src/filenot.c
index 5cd6959..c1fcffa 100644
--- a/src/filenot.c
+++ b/src/filenot.c
@@ -38,7 +38,7 @@ get_absolute_name (const char *file)
     char dir[MC_MAXPATHLEN];
 
     if (file[0] == PATH_SEP)
-	return mhl_str_dup (file);
+	return g_strdup (file);
     mc_get_current_wd (dir, MC_MAXPATHLEN);
     return mhl_str_dir_plus_file (dir, file);
 }
diff --git a/src/find.c b/src/find.c
index 023fc68..7ae6bb9 100644
--- a/src/find.c
+++ b/src/find.c
@@ -250,11 +250,11 @@ find_parameters (char **start_dir, char **pattern, char **content)
 
   find_par_start:
     if (!in_start_dir)
-	in_start_dir = mhl_str_dup (".");
+	in_start_dir = g_strdup (".");
     if (!in_start_name)
-	in_start_name = mhl_str_dup (easy_patterns ? "*" : ".");
+	in_start_name = g_strdup (easy_patterns ? "*" : ".");
     if (!in_contents)
-	in_contents = mhl_str_dup ("");
+	in_contents = g_strdup ("");
 
     find_dlg =
 	create_dlg (0, 0, FIND_Y, FIND_X, dialog_colors,
@@ -304,7 +304,7 @@ find_parameters (char **start_dir, char **pattern, char **content)
 	break;
 
     case B_TREE:
-	temp_dir = mhl_str_dup (in_start->buffer);
+	temp_dir = g_strdup (in_start->buffer);
 	case_sensitive = case_sense->state & C_BOOL;
 	find_regex_flag = find_regex_cbox->state & C_BOOL;
  	find_recursively = recursively_cbox->state & C_BOOL;
@@ -312,7 +312,7 @@ find_parameters (char **start_dir, char **pattern, char **content)
 	g_free (in_start_dir);
 	if (strcmp (temp_dir, ".") == 0) {
 	    g_free (temp_dir);
-	    temp_dir = mhl_str_dup (current_panel->cwd);
+	    temp_dir = g_strdup (current_panel->cwd);
 	}
 	in_start_dir = tree_box (temp_dir);
 	if (in_start_dir)
@@ -326,8 +326,8 @@ find_parameters (char **start_dir, char **pattern, char **content)
     default:
 	g_free (in_contents);
 	if (in_with->buffer[0]) {
-	    *content = mhl_str_dup (in_with->buffer);
-	    in_contents = mhl_str_dup (*content);
+	    *content = g_strdup (in_with->buffer);
+	    in_contents = g_strdup (*content);
 	} else {
 	    *content = in_contents = NULL;
 	    r = 0;
@@ -337,13 +337,13 @@ find_parameters (char **start_dir, char **pattern, char **content)
 	find_regex_flag = find_regex_cbox->state & C_BOOL;
  	find_recursively = recursively_cbox->state & C_BOOL;
 	return_value = 1;
-	*start_dir = mhl_str_dup (in_start->buffer);
-	*pattern = mhl_str_dup (in_name->buffer);
+	*start_dir = g_strdup (in_start->buffer);
+	*pattern = g_strdup (in_name->buffer);
 
 	g_free (in_start_dir);
-	in_start_dir = mhl_str_dup (*start_dir);
+	in_start_dir = g_strdup (*start_dir);
 	g_free (in_start_name);
-	in_start_name = mhl_str_dup (*pattern);
+	in_start_name = g_strdup (*pattern);
     }
 
     destroy_dlg (find_dlg);
@@ -390,11 +390,11 @@ insert_file (const char *dir, const char *file)
     if (old_dir){
 	if (strcmp (old_dir, dir)){
 	    g_free (old_dir);
-	    old_dir = mhl_str_dup (dir);
+	    old_dir = g_strdup (dir);
 	    dirname = add_to_list (dir, NULL);
 	}
     } else {
-	old_dir = mhl_str_dup (dir);
+	old_dir = g_strdup (dir);
 	dirname = add_to_list (dir, NULL);
     }
     
@@ -753,7 +753,7 @@ make_fullname (const char *dirname, const char *filename)
 {
 
     if (strcmp(dirname, ".") == 0 || strcmp(dirname, "."PATH_SEP_STR) == 0)
-	return mhl_str_dup (filename);
+	return g_strdup (filename);
     if (strncmp(dirname, "."PATH_SEP_STR, 2) == 0)
 	return mhl_str_dir_plus_file (dirname + 2, filename);
     return mhl_str_dir_plus_file (dirname, filename);
@@ -984,9 +984,9 @@ find_file (char *start_dir, char *pattern, char *content, char **dirname,
     get_list_info (&file_tmp, &dir_tmp);
 
     if (dir_tmp)
-	*dirname = mhl_str_dup (dir_tmp);
+	*dirname = g_strdup (dir_tmp);
     if (file_tmp)
-	*filename = mhl_str_dup (file_tmp);
+	*filename = g_strdup (file_tmp);
 
     if (return_value == B_PANELIZE && *filename) {
 	int status, link_to_dir, stale_link;
diff --git a/src/help.c b/src/help.c
index f27c503..b06c188 100644
--- a/src/help.c
+++ b/src/help.c
@@ -106,7 +106,7 @@ static const char *
 search_string (const char *start, const char *text)
 {
     const char *result = NULL;
-    char *local_text = mhl_str_dup (text);
+    char *local_text = g_strdup (text);
     char *d = local_text;
     const char *e = start;
 
diff --git a/src/hotlist.c b/src/hotlist.c
index d80f489..ee8f3bd 100644
--- a/src/hotlist.c
+++ b/src/hotlist.c
@@ -935,7 +935,7 @@ static void add_new_entry_cmd (void)
     int ret;
 
     /* Take current directory as default value for input fields */
-    to_free = title = url = strip_password (mhl_str_dup (current_panel->cwd), 1);
+    to_free = title = url = strip_password (g_strdup (current_panel->cwd), 1);
 
     ret = add_new_entry_input (_("New hotlist entry"), _("Directory label"),
 			       _("Directory path"), "[Hotlist]", &title, &url);
@@ -1040,7 +1040,7 @@ void add2hotlist_cmd (void)
     char *prompt, *label;
     const char *cp = _("Label for \"%s\":");
     int l = strlen (cp);
-    char *label_string = mhl_str_dup (current_panel->cwd);
+    char *label_string = g_strdup (current_panel->cwd);
 
     strip_password (label_string, 1);
 
@@ -1157,9 +1157,9 @@ char *hotlist_cmd (int vfs_or_hotlist)
     case B_ENTER:
 	if (l_hotlist->current->data) {
 	    struct hotlist *hlp = (struct hotlist*) l_hotlist->current->data;
-	    target = mhl_str_dup (hlp->directory);
+	    target = g_strdup (hlp->directory);
 	} else
-	    target = mhl_str_dup (l_hotlist->current->text);
+	    target = g_strdup (l_hotlist->current->text);
 	break;
     }
 
@@ -1183,7 +1183,7 @@ load_group (struct hotlist *grp)
 
     while (profile_keys){
 	profile_keys = profile_iterator_next (profile_keys, &key, &value);
-	add2hotlist (mhl_str_dup (value), mhl_str_dup (key), HL_TYPE_GROUP, 0);
+	add2hotlist (g_strdup (value), g_strdup (key), HL_TYPE_GROUP, 0);
     }
     g_free (group_section);
 
@@ -1191,7 +1191,7 @@ load_group (struct hotlist *grp)
 
     while (profile_keys){
 	profile_keys = profile_iterator_next (profile_keys, &key, &value);
-	add2hotlist (mhl_str_dup (value),mhl_str_dup (key), HL_TYPE_ENTRY, 0);
+	add2hotlist (g_strdup (value),g_strdup (key), HL_TYPE_ENTRY, 0);
     }
 
     for (current = grp->head; current; current = current->next)
@@ -1333,22 +1333,22 @@ hot_load_group (struct hotlist * grp)
 	switch (tkn) {
 	case TKN_GROUP:
 	    CHECK_TOKEN(TKN_STRING);
-	    new_grp = add2hotlist (mhl_str_dup (tkn_buf), 0, HL_TYPE_GROUP, 0);
+	    new_grp = add2hotlist (g_strdup (tkn_buf), 0, HL_TYPE_GROUP, 0);
 	    SKIP_TO_EOL;
 	    hot_load_group (new_grp);
 	    current_group = grp;
 	    break;
 	case TKN_ENTRY:
 	    CHECK_TOKEN(TKN_STRING);
-	    label = mhl_str_dup (tkn_buf);
+	    label = g_strdup (tkn_buf);
 	    CHECK_TOKEN(TKN_URL);
 	    CHECK_TOKEN(TKN_STRING);
-	    url = mhl_str_dup (tkn_buf);
+	    url = g_strdup (tkn_buf);
 	    add2hotlist (label, url, HL_TYPE_ENTRY, 0);
 	    SKIP_TO_EOL;
 	    break;
 	case TKN_COMMENT:
-	    label = mhl_str_dup (tkn_buf);
+	    label = g_strdup (tkn_buf);
 	    add2hotlist (label, 0, HL_TYPE_COMMENT, 0);
 	    break;
 	case TKN_EOF:
@@ -1381,22 +1381,22 @@ hot_load_file (struct hotlist * grp)
 	switch (tkn) {
 	case TKN_GROUP:
 	    CHECK_TOKEN(TKN_STRING);
-	    new_grp = add2hotlist (mhl_str_dup (tkn_buf), 0, HL_TYPE_GROUP, 0);
+	    new_grp = add2hotlist (g_strdup (tkn_buf), 0, HL_TYPE_GROUP, 0);
 	    SKIP_TO_EOL;
 	    hot_load_group (new_grp);
 	    current_group = grp;
 	    break;
 	case TKN_ENTRY:
 	    CHECK_TOKEN(TKN_STRING);
-	    label = mhl_str_dup (tkn_buf);
+	    label = g_strdup (tkn_buf);
 	    CHECK_TOKEN(TKN_URL);
 	    CHECK_TOKEN(TKN_STRING);
-	    url = mhl_str_dup (tkn_buf);
+	    url = g_strdup (tkn_buf);
 	    add2hotlist (label, url, HL_TYPE_ENTRY, 0);
 	    SKIP_TO_EOL;
 	    break;
 	case TKN_COMMENT:
-	    label = mhl_str_dup (tkn_buf);
+	    label = g_strdup (tkn_buf);
 	    add2hotlist (label, 0, HL_TYPE_COMMENT, 0);
 	    break;
 	case TKN_EOL:
@@ -1453,12 +1453,12 @@ load_hotlist (void)
     
     hotlist	       = new_hotlist ();
     hotlist->type      = HL_TYPE_GROUP;
-    hotlist->label     = mhl_str_dup (_(" Top level group "));
+    hotlist->label     = g_strdup (_(" Top level group "));
     hotlist->up        = hotlist;
     /*
      * compatibility :-(
      */
-    hotlist->directory = mhl_str_dup ("Hotlist");
+    hotlist->directory = g_strdup ("Hotlist");
 
     if ((hotlist_file = fopen (hotlist_file_name, "r")) == 0) {
 	int	result;
@@ -1613,6 +1613,6 @@ add_dotdot_to_list (void)
 {
     if (current_group != hotlist) {
 	if (hotlist_has_dot_dot != 0)
-	    add2hotlist (mhl_str_dup (".."), mhl_str_dup (".."), HL_TYPE_DOTDOT, 0);
+	    add2hotlist (g_strdup (".."), g_strdup (".."), HL_TYPE_DOTDOT, 0);
     }
 }
diff --git a/src/key.c b/src/key.c
index f2b6bf3..2447c5b 100644
--- a/src/key.c
+++ b/src/key.c
@@ -1235,7 +1235,7 @@ char *learn_key (void)
     keypad(stdscr, TRUE);
     nodelay (stdscr, FALSE);
     *p = 0;
-    return mhl_str_dup (buffer);
+    return g_strdup (buffer);
 }
 
 /* xterm and linux console only: set keypad to numeric or application
diff --git a/src/layout.c b/src/layout.c
index 8e1d10d..9d91845 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -1055,13 +1055,13 @@ void swap_panels ()
 	if (panels [0].type == view_listing) {
             if (!strcmp (panel1->panel_name, get_nth_panel_name (0))) {
                 g_free (panel1->panel_name);
-                panel1->panel_name = mhl_str_dup (get_nth_panel_name (1));
+                panel1->panel_name = g_strdup (get_nth_panel_name (1));
             }
         }
         if (panels [1].type == view_listing) {
             if (!strcmp (panel2->panel_name, get_nth_panel_name (1))) {
                 g_free (panel2->panel_name);
-                panel2->panel_name = mhl_str_dup (get_nth_panel_name (0));
+                panel2->panel_name = g_strdup (get_nth_panel_name (0));
             }
         }
         
diff --git a/src/listmode.c b/src/listmode.c
index 84af113..69e499d 100644
--- a/src/listmode.c
+++ b/src/listmode.c
@@ -26,12 +26,11 @@
 
 #include <stdio.h>
 #include <string.h>
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <mhl/string.h>
-
 #include "global.h"
 #include "tty.h"
 #include "win.h"
@@ -288,7 +287,7 @@ listmode_edit (char *oldlistformat)
     char *s;
     Dlg_head *listmode_dlg;
 
-    s = mhl_str_dup (oldlistformat);
+    s = g_strdup (oldlistformat);
     listmode_dlg = init_listmode (s);
     g_free (s);
 
diff --git a/src/main.c b/src/main.c
index 138c035..881a3d6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -336,7 +336,7 @@ update_one_panel_widget (WPanel *panel, int force_update,
     /* If current_file == -1 (an invalid pointer) then preserve selection */
     if (current_file == UP_KEEPSEL) {
 	free_pointer = 1;
-	my_current_file = mhl_str_dup (panel->dir.list[panel->selected].fname);
+	my_current_file = g_strdup (panel->dir.list[panel->selected].fname);
 	current_file = my_current_file;
     } else
 	free_pointer = 0;
@@ -533,7 +533,7 @@ directory_history_add (struct WPanel *panel, const char *dir)
 {
     char *tmp;
 
-    tmp = mhl_str_dup (dir);
+    tmp = g_strdup (dir);
     strip_password (tmp, 1);
 
     panel->dir_history = list_append_unique (panel->dir_history, tmp);
@@ -575,7 +575,7 @@ _do_panel_cd (WPanel *panel, const char *new_dir, enum cd_enum cd_type)
 	    new_dir++;
     }
 
-    olddir = mhl_str_dup (panel->cwd);
+    olddir = g_strdup (panel->cwd);
     new_dir = translated_url = vfs_translate_url (new_dir);
 
     /* Convert *new_path to a suitable pathname, handle ~user */
@@ -1613,7 +1613,7 @@ update_xterm_title_path (void)
     char *p, *s;
 
     if (xterm_flag && xterm_title) {
-	p = s = mhl_str_dup (strip_home_and_password (current_panel->cwd));
+	p = s = g_strdup (strip_home_and_password (current_panel->cwd));
 	do {
 	    if (!is_printable ((unsigned char) *s))
 		*s = '?';
@@ -1687,7 +1687,7 @@ prepend_cwd_on_local (const char *filename)
 
     if (vfs_file_is_local (filename)) {
 	if (*filename == PATH_SEP)	/* an absolute pathname */
-	    return mhl_str_dup (filename);
+	    return g_strdup (filename);
 	d = g_malloc (MC_MAXPATHLEN + strlen (filename) + 2);
 	mc_get_current_wd (d, MC_MAXPATHLEN);
 	l = strlen (d);
@@ -1696,7 +1696,7 @@ prepend_cwd_on_local (const char *filename)
 	canonicalize_pathname (d);
 	return d;
     } else
-	return mhl_str_dup (filename);
+	return g_strdup (filename);
 }
 
 static int
@@ -1754,7 +1754,7 @@ do_nc (void)
 
     /* destroy_dlg destroys even current_panel->cwd, so we have to save a copy :) */
     if (last_wd_file && vfs_current_is_local ()) {
-	last_wd_string = mhl_str_dup (current_panel->cwd);
+	last_wd_string = g_strdup (current_panel->cwd);
     }
     done_mc ();
 
@@ -1773,7 +1773,7 @@ OS_Setup (void)
         struct passwd *pwd;
         pwd = getpwuid (geteuid ());
         if (pwd != NULL)
-           shell = mhl_str_dup (pwd->pw_shell);
+           shell = g_strdup (pwd->pw_shell);
     }
     if (!shell || !*shell)
 	shell = "/bin/sh";
@@ -1781,9 +1781,9 @@ OS_Setup (void)
     /* This is the directory, where MC was installed, on Unix this is DATADIR */
     /* and can be overriden by the MC_DATADIR environment variable */
     if ((mc_libdir = getenv ("MC_DATADIR")) != NULL) {
-	mc_home = mhl_str_dup (mc_libdir);
+	mc_home = g_strdup (mc_libdir);
     } else {
-	mc_home = mhl_str_dup (DATADIR);
+	mc_home = g_strdup (DATADIR);
     }
 }
 
@@ -2094,12 +2094,12 @@ handle_args (int argc, char *argv[])
 			}
 		    }
 		}
-		edit_one_file = mhl_str_dup (tmp);
+		edit_one_file = g_strdup (tmp);
 	    }
 	}
     } else if (!STRNCOMP (base, "mcv", 3) || !STRCOMP (base, "view")) {
 	if (tmp)
-	    view_one_file = mhl_str_dup (tmp);
+	    view_one_file = g_strdup (tmp);
 	else {
 	    fputs ("No arguments given to the viewer\n", stderr);
 	    exit (1);
@@ -2107,9 +2107,9 @@ handle_args (int argc, char *argv[])
     } else {
 	/* sets the current dir and the other dir */
 	if (tmp) {
-	    this_dir = mhl_str_dup (tmp);
+	    this_dir = g_strdup (tmp);
 	    if ((tmp = poptGetArg (ctx)))
-		other_dir = mhl_str_dup (tmp);
+		other_dir = g_strdup (tmp);
 	}
     }
 
diff --git a/src/menu.c b/src/menu.c
index 16ad773..ba25bf7 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -83,10 +83,10 @@ create_menu (const char *name, menu_entry *entries, int count, const char *help_
 	}
     }
 
-    menu->name = mhl_str_dup (name);
+    menu->name = g_strdup (name);
     menu_scan_hotkey(menu);
     menu->start_x = 0;
-    menu->help_node = mhl_str_dup (help_node);
+    menu->help_node = g_strdup (help_node);
     return menu;
 }
 
diff --git a/src/panelize.c b/src/panelize.c
index 7cb8c4e..d79d2b9 100644
--- a/src/panelize.c
+++ b/src/panelize.c
@@ -238,7 +238,7 @@ add2panelize_cmd (void)
 	    return;
 	}
 	
-	add2panelize (label, mhl_str_dup (pname->buffer));
+	add2panelize (label, g_strdup (pname->buffer));
     }
 }
 
@@ -295,7 +295,7 @@ external_panelize (void)
     case B_ENTER:
 	target = pname->buffer;
 	if (target != NULL && *target) {
-	    char *cmd = mhl_str_dup (target);
+	    char *cmd = g_strdup (target);
 	    destroy_dlg (panelize_dlg);
 	    do_external_panelize (cmd);
 	    g_free (cmd);
@@ -315,18 +315,18 @@ void load_panelize (void)
     
     profile_keys = profile_init_iterator (panelize_section, profile_name);
     
-    add2panelize (mhl_str_dup (_("Other command")), mhl_str_dup (""));
+    add2panelize (g_strdup (_("Other command")), g_strdup (""));
 
     if (!profile_keys){
-	add2panelize (mhl_str_dup (_("Find rejects after patching")), mhl_str_dup ("find . -name \\*.rej -print"));
-	add2panelize (mhl_str_dup (_("Find *.orig after patching")), mhl_str_dup ("find . -name \\*.orig -print"));
-	add2panelize (mhl_str_dup (_("Find SUID and SGID programs")), mhl_str_dup ("find . \\( \\( -perm -04000 -a -perm +011 \\) -o \\( -perm -02000 -a -perm +01 \\) \\) -print"));
+	add2panelize (g_strdup (_("Find rejects after patching")), g_strdup ("find . -name \\*.rej -print"));
+	add2panelize (g_strdup (_("Find *.orig after patching")), g_strdup ("find . -name \\*.orig -print"));
+	add2panelize (g_strdup (_("Find SUID and SGID programs")), g_strdup ("find . \\( \\( -perm -04000 -a -perm +011 \\) -o \\( -perm -02000 -a -perm +01 \\) \\) -print"));
 	return;
     }
     
     while (profile_keys){
 	profile_keys = profile_iterator_next (profile_keys, &key, &value);
-	add2panelize (mhl_str_dup (key), mhl_str_dup (value));
+	add2panelize (g_strdup (key), g_strdup (value));
     }
 }
 
@@ -400,7 +400,7 @@ static void do_external_panelize (char *command)
 	if (status == -1)
 	    break;
 	list->list [next_free].fnamelen = strlen (name);
-	list->list [next_free].fname = mhl_str_dup (name);
+	list->list [next_free].fname = g_strdup (name);
 	file_mark (current_panel, next_free, 0);
 	list->list [next_free].f.link_to_dir = link_to_dir;
 	list->list [next_free].f.stale_link = stale_link;
diff --git a/src/profile.c b/src/profile.c
index 2877ebb..07c201e 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -170,7 +170,7 @@ static TSecHeader *load (const char *file)
 	    if (c == ']' || overflow){
 		*next = '\0';
 		next = CharBuffer;
-		SecHeader->AppName = mhl_str_dup (CharBuffer);
+		SecHeader->AppName = g_strdup (CharBuffer);
 		state = IgnoreToEOL;
 	    } else
 		*next++ = c;
@@ -216,7 +216,7 @@ static TSecHeader *load (const char *file)
 		*next = '\0';
 		SecHeader->Keys =g_new (TKeys, 1);
 		SecHeader->Keys->link = temp;
-		SecHeader->Keys->KeyName = mhl_str_dup (CharBuffer);
+		SecHeader->Keys->KeyName = g_strdup (CharBuffer);
 		state = KeyValue;
 		next = CharBuffer;
 	    } else {
@@ -267,8 +267,8 @@ static void new_key (TSecHeader *section, const char *KeyName, const char *Value
     TKeys *key;
     
     key = g_new (TKeys, 1);
-    key->KeyName = mhl_str_dup (KeyName);
-    key->Value   = mhl_str_dup (Value);
+    key->KeyName = g_strdup (KeyName);
+    key->Value   = g_strdup (Value);
     key->link = section->Keys;
     section->Keys = key;
 }
@@ -286,7 +286,7 @@ GetSetProfileChar (int set, const char *AppName, const char *KeyName,
     if (!Current) {
 	Current = g_new (TProfile, 1);
 	Current->link = Base;
-	Current->FileName = mhl_str_dup (FileName);
+	Current->FileName = g_strdup (FileName);
 	Current->Section = load (FileName);
 	Base = Current;
 	section = Current->Section;
@@ -301,7 +301,7 @@ GetSetProfileChar (int set, const char *AppName, const char *KeyName,
 		continue;
 	    if (set){
 		g_free (key->Value);
-		key->Value = mhl_str_dup (Default);
+		key->Value = g_strdup (Default);
 	    }
 	    return key->Value;
 	}
@@ -317,7 +317,7 @@ GetSetProfileChar (int set, const char *AppName, const char *KeyName,
     /* Non existent section */
     if (set && Default){
 	section = g_new (TSecHeader, 1);
-	section->AppName = mhl_str_dup (AppName);
+	section->AppName = g_strdup (AppName);
 	section->Keys = 0;
 	new_key (section, KeyName, Default);
 	section->link = Current->Section;
@@ -485,7 +485,7 @@ void *profile_init_iterator (const char *appname, const char *file)
     if (!Current) {
 	Current = g_new (TProfile, 1);
 	Current->link = Base;
-	Current->FileName = mhl_str_dup (file);
+	Current->FileName = g_strdup (file);
 	Current->Section = load (file);
 	Base = Current;
 	section = Current->Section;
diff --git a/src/screen.c b/src/screen.c
index c52d292..369f1fd 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -946,7 +946,7 @@ panel_save_name (WPanel *panel)
 
     /* If the program is shuting down */
     if ((midnight_shutdown && auto_save_setup) || saving_setup)
-	return  mhl_str_dup (panel->panel_name);
+	return  g_strdup (panel->panel_name);
     else
 	return  g_strconcat ("Temporal:", panel->panel_name, (char *) NULL);
 }
@@ -1031,18 +1031,18 @@ panel_new (const char *panel_name)
     panel->status_format = 0;
     panel->format_modified = 1;
 
-    panel->panel_name = mhl_str_dup (panel_name);
-    panel->user_format = mhl_str_dup (DEFAULT_USER_FORMAT);
+    panel->panel_name = g_strdup (panel_name);
+    panel->user_format = g_strdup (DEFAULT_USER_FORMAT);
 
     for (i = 0; i < LIST_TYPES; i++)
-	panel->user_status_format[i] = mhl_str_dup (DEFAULT_USER_FORMAT);
+	panel->user_status_format[i] = g_strdup (DEFAULT_USER_FORMAT);
 
     panel->search_buffer[0] = 0;
     panel->frame_size = frame_half;
     section = g_strconcat ("Temporal:", panel->panel_name, (char *) NULL);
     if (!profile_has_section (section, profile_name)) {
 	g_free (section);
-	section = mhl_str_dup (panel->panel_name);
+	section = g_strdup (panel->panel_name);
     }
     panel_load_setup (panel, section);
     g_free (section);
@@ -1322,7 +1322,7 @@ parse_display_format (WPanel *panel, const char *format, char **error, int issta
 	    break;
 	}
 	if (!found){
-	    char *tmp_format = mhl_str_dup (format);
+	    char *tmp_format = g_strdup (format);
 
 	    int pos = min (8, strlen (format));
 	    delete_format (home);
@@ -1450,11 +1450,11 @@ set_panel_formats (WPanel *p)
       message( 1, _("Warning" ), _( "User supplied format looks invalid, reverting to default." ) );
     if (retcode & 0x01){
       g_free (p->user_format);
-      p->user_format = mhl_str_dup (DEFAULT_USER_FORMAT);
+      p->user_format = g_strdup (DEFAULT_USER_FORMAT);
     }
     if (retcode & 0x02){
       g_free (p->user_status_format [p->list_type]);
-      p->user_status_format [p->list_type] = mhl_str_dup (DEFAULT_USER_FORMAT);
+      p->user_status_format [p->list_type] = g_strdup (DEFAULT_USER_FORMAT);
     }
 
     return retcode;
@@ -2099,7 +2099,7 @@ chdir_to_readlink (WPanel *panel)
 	    p[1] = 0;
 	}
 	if (*buffer == PATH_SEP)
-	    new_dir = mhl_str_dup (buffer);
+	    new_dir = g_strdup (buffer);
 	else
 	    new_dir = mhl_str_dir_plus_file (panel->cwd, buffer);
 
@@ -2253,7 +2253,7 @@ panel_callback (Widget *w, widget_msg_t msg, int parm)
 	current_panel = panel;
 	panel->active = 1;
 	if (mc_chdir (panel->cwd) != 0) {
-	    char *cwd = strip_password (mhl_str_dup (panel->cwd), 1);
+	    char *cwd = strip_password (g_strdup (panel->cwd), 1);
 	    message (D_ERROR, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "),
 		     cwd, unix_error_string (errno));
 	    g_free(cwd);
@@ -2465,7 +2465,7 @@ panel_re_sort (WPanel *panel)
     if (panel == NULL)
 	    return;
 
-    filename = mhl_str_dup (selection (panel)->fname);
+    filename = g_strdup (selection (panel)->fname);
     unselect_item (panel);
     do_sort (&panel->dir, panel->sort_type, panel->count-1, panel->reverse,
              panel->case_sensitive, panel->exec_first);
@@ -2496,7 +2496,7 @@ panel_set_sort_order (WPanel *panel, sortfn *sort_order)
     if (sort_order == (sortfn *) unsorted){
 	char *current_file;
 
-	current_file = mhl_str_dup (panel->dir.list [panel->selected].fname);
+	current_file = g_strdup (panel->dir.list [panel->selected].fname);
 	panel_reload (panel);
 	try_to_select (panel, current_file);
 	g_free (current_file);
diff --git a/src/setup.c b/src/setup.c
index 221bd88..d46c408 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -471,7 +471,7 @@ do_load_string (const char *s, const char *ss, const char *def)
 
     load_string (s, ss, def, buffer, BUF_SMALL);
 
-    p = mhl_str_dup (buffer);
+    p = g_strdup (buffer);
     g_free (buffer);
     return p;
 }
@@ -596,7 +596,7 @@ load_anon_passwd ()
 
     load_string ("Misc", "ftpfs_password", "", buffer, sizeof (buffer));
     if (buffer [0])
-	return mhl_str_dup (buffer);
+	return g_strdup (buffer);
     else
 	return 0;
 }
diff --git a/src/subshell.c b/src/subshell.c
index c6015e5..f336602 100644
--- a/src/subshell.c
+++ b/src/subshell.c
@@ -232,7 +232,7 @@ init_subshell_child (const char *pty_name)
 	char sid_str[BUF_SMALL];
 	snprintf (sid_str, sizeof (sid_str), "MC_SID=%ld",
 		    (long) mc_sid);
-	putenv (mhl_str_dup (sid_str));
+	putenv (g_strdup (sid_str));
     }
 #endif				/* HAVE_GETSID */
 
@@ -799,7 +799,7 @@ do_subshell_chdir (const char *directory, int do_update, int reset_prompt)
 	}
 
 	if (bPathNotEq && strcmp (current_panel->cwd, ".")) {
-	    char *cwd = strip_password (mhl_str_dup (current_panel->cwd), 1);
+	    char *cwd = strip_password (g_strdup (current_panel->cwd), 1);
 	    fprintf (stderr, _("Warning: Cannot change to %s.\n"), cwd);
 	    g_free (cwd);
 	}
diff --git a/src/treestore.c b/src/treestore.c
index 64c4323..5826556 100644
--- a/src/treestore.c
+++ b/src/treestore.c
@@ -137,7 +137,7 @@ tree_store_get(void)
 static char *
 decode(char *buffer)
 {
-    char *res = mhl_str_dup(buffer);
+    char *res = g_strdup(buffer);
     char *p, *q;
 
     for (p = q = res; *p; p++, q++) {
@@ -446,7 +446,7 @@ tree_store_add_entry(const char *name)
     }
 
     /* Calculate attributes */
-    new->name = mhl_str_dup(name);
+    new->name = g_strdup(name);
     len = strlen(new->name);
     new->sublevel = 0;
     for (i = 0; i < len; i++)
@@ -474,7 +474,7 @@ tree_store_add_entry(const char *name)
 
     if (new->sublevel > 1) {
 	/* Let's check if the parent directory is in the tree */
-	char *parent = mhl_str_dup(new->name);
+	char *parent = g_strdup(new->name);
 	int i;
 
 	for (i = strlen(parent) - 1; i > 1; i--) {
@@ -618,7 +618,7 @@ tree_store_mark_checked(const char *subname)
     if (flag != 0) {
 	/* Doesn't exist -> add it */
 	current = tree_store_add_entry(name);
-	ts.add_queue = g_list_prepend(ts.add_queue, mhl_str_dup(name));
+	ts.add_queue = g_list_prepend(ts.add_queue, g_strdup(name));
     }
     g_free(name);
 
@@ -663,12 +663,12 @@ tree_store_start_check(const char *path)
 	    return NULL;
 
 	current = tree_store_add_entry(path);
-	ts.check_name = mhl_str_dup(path);
+	ts.check_name = g_strdup(path);
 
 	return current;
     }
 
-    ts.check_name = mhl_str_dup(path);
+    ts.check_name = g_strdup(path);
 
     retval = current;
 
@@ -740,7 +740,7 @@ process_special_dirs(GList ** special_dirs, char *file)
 			    "", buffer, 4096, file);
     s = buffer;
     while ((token = strtok(s, ",")) != NULL) {
-	*special_dirs = g_list_prepend(*special_dirs, mhl_str_dup(token));
+	*special_dirs = g_list_prepend(*special_dirs, g_strdup(token));
 	s = NULL;
     }
     g_free(buffer);
diff --git a/src/user.c b/src/user.c
index e0a551c..14e3d69 100644
--- a/src/user.c
+++ b/src/user.c
@@ -147,7 +147,7 @@ int check_format_var (const char *p, char **v)
 	value = getenv (var_name);
 	g_free (var_name);
 	if (value){
-	    *v = mhl_str_dup (value);
+	    *v = g_strdup (value);
 	    return q-p;
 	}	
 	var_name = g_strndup (dots, q - dots);
@@ -182,7 +182,7 @@ expand_format (struct WEdit *edit_widget, char c, int quote)
     char c_lc;
 
     if (c == '%')
-	return mhl_str_dup ("%");
+	return g_strdup ("%");
 
     if (edit_one_file != NULL)
 	fname = edit_widget->filename;
@@ -191,7 +191,7 @@ expand_format (struct WEdit *edit_widget, char c, int quote)
 	    panel = current_panel;
 	else {
 	    if (get_other_type () != view_listing)
-		return mhl_str_dup ("");
+		return g_strdup ("");
 	    panel = other_panel;
 	}
 	fname = panel->dir.list[panel->selected].fname;
@@ -234,7 +234,7 @@ expand_format (struct WEdit *edit_widget, char c, int quote)
 	break;
     case 'y':			/* syntax type */
 	if (edit_widget && edit_widget->syntax_type)
-	    return mhl_str_dup (edit_widget->syntax_type);
+	    return g_strdup (edit_widget->syntax_type);
 	break;
     case 'k':			/* block file name */
     case 'b':			/* block file name / strip extension */  {
@@ -269,7 +269,7 @@ expand_format (struct WEdit *edit_widget, char c, int quote)
 	    char *block, *tmp;
 
 	    if (!panel)
-		return mhl_str_dup ("");
+		return g_strdup ("");
 
 	    for (i = 0; i < panel->count; i++)
 		if (panel->dir.list[i].f.marked)
@@ -289,7 +289,7 @@ expand_format (struct WEdit *edit_widget, char c, int quote)
 	    return block;
 	}			/* sub case block */
     }				/* switch */
-    result = mhl_str_dup ("% ");
+    result = g_strdup ("% ");
     result[1] = c;
     return result;
 }
@@ -721,7 +721,7 @@ user_menu_cmd (struct WEdit *edit_widget)
 	return;
     }
     
-    menu = mhl_str_dup (edit_widget ? CEDIT_LOCAL_MENU : MC_LOCAL_MENU);
+    menu = g_strdup (edit_widget ? CEDIT_LOCAL_MENU : MC_LOCAL_MENU);
     if (!exist_file (menu) || !menu_file_own (menu)){
 	g_free (menu);
         menu = mhl_str_dir_plus_file \
diff --git a/src/util.c b/src/util.c
index 5e8a79c..ea647f0 100644
--- a/src/util.c
+++ b/src/util.c
@@ -221,7 +221,7 @@ char *
 fake_name_quote (const char *s, int quote_percent)
 {
     (void) quote_percent;
-    return mhl_str_dup (s);
+    return g_strdup (s);
 }
 
 /*
@@ -268,7 +268,7 @@ name_trunc (const char *txt, size_t trunc_len)
 const char *
 path_trunc (const char *path, size_t trunc_len) {
     const char *ret;
-    char *secure_path = strip_password (mhl_str_dup (path), 1);
+    char *secure_path = strip_password (g_strdup (path), 1);
     
     ret = name_trunc (secure_path, trunc_len);
     g_free (secure_path);
@@ -587,7 +587,7 @@ convert_pattern (const char *pattern, int match_type, int do_group)
 	*d = 0;
 	return new_pattern;
     } else
-	return  mhl_str_dup (pattern);
+	return  g_strdup (pattern);
 }
 
 int
@@ -644,7 +644,7 @@ get_config_string (const char *file, const char *key, const char *defval)
 {
     char buffer[1024];
     (void)GetPrivateProfileString (app_text, key, defval, buffer, sizeof(buffer), file);
-    return mhl_str_dup (buffer);
+    return g_strdup (buffer);
 }
 
 extern void
@@ -1098,7 +1098,7 @@ wipe_password (char *passwd)
 char *
 convert_controls (const char *p)
 {
-    char *valcopy = mhl_str_dup (p);
+    char *valcopy = g_strdup (p);
     char *q;
 
     /* Parse the escape special character */
@@ -1315,7 +1315,7 @@ mc_mkstemps (char **pname, const char *prefix, const char *suffix)
 	/* Add prefix first to find the position of XXXXXX */
 	tmpbase = mhl_str_dir_plus_file (mc_tmpdir (), prefix);
     } else {
-	tmpbase = mhl_str_dup (prefix);
+	tmpbase = g_strdup (prefix);
     }
 
     tmpname = g_strconcat (tmpbase, "XXXXXX", suffix, (char *) NULL);
diff --git a/src/utilunix.c b/src/utilunix.c
index c322ef0..f3bdce1 100644
--- a/src/utilunix.c
+++ b/src/utilunix.c
@@ -76,7 +76,7 @@ static void i_cache_add (int id, int_cache *cache, int size, char *text,
 			 int *last)
 {
     g_free (cache [*last].string);
-    cache [*last].string = mhl_str_dup (text);
+    cache [*last].string = g_strdup (text);
     cache [*last].index = id;
     *last = ((*last)+1) % size;
 }
@@ -190,7 +190,7 @@ tilde_expand (const char *directory)
     char *name;
 
     if (*directory != '~')
-	return mhl_str_dup (directory);
+	return g_strdup (directory);
 
     p = directory + 1;
 
@@ -212,7 +212,7 @@ tilde_expand (const char *directory)
 
     /* If we can't figure the user name, leave tilde unexpanded */
     if (!passwd)
-	return mhl_str_dup (directory);
+	return g_strdup (directory);
 
     return g_strconcat (passwd->pw_dir, PATH_SEP_STR, q, (char *) NULL);
 }
diff --git a/src/vfsdummy.h b/src/vfsdummy.h
index 4114dc2..06d39c2 100644
--- a/src/vfsdummy.h
+++ b/src/vfsdummy.h
@@ -3,8 +3,6 @@
 #ifndef MC_VFSDUMMY_H
 #define MC_VFSDYMMY_H
 
-#include <mhl/string.h>
-
 /* Flags of VFS classes */
 #define VFSF_LOCAL 1		/* Class is local (not virtual) filesystem */
 #define VFSF_NOLINKS 2		/* Hard links not supported */
@@ -56,12 +54,12 @@ return_zero (void)
 
 #define vfs_current_is_local() 1
 #define vfs_file_is_local(x) 1
-#define vfs_strip_suffix_from_filename(x) mhl_str_dup(x)
+#define vfs_strip_suffix_from_filename(x) g_strdup(x)
 
 #define vfs_file_class_flags(x) (VFSF_LOCAL)
 #define vfs_get_class(x) (struct vfs_class *)(NULL)
 
-#define vfs_translate_url(s) mhl_str_dup(s)
+#define vfs_translate_url(s) g_strdup(s)
 #define vfs_release_path(x)
 #define vfs_add_current_stamps() do { } while (0)
 #define vfs_timeout_handler() do { } while (0)
@@ -70,7 +68,7 @@ return_zero (void)
 static inline char *
 vfs_canon (const char *path)
 {
-    char *p = mhl_str_dup (path);
+    char *p = g_strdup (path);
     canonicalize_pathname(p);
     return p;
 }
diff --git a/src/view.c b/src/view.c
index cd255cf..47c2d4f 100644
--- a/src/view.c
+++ b/src/view.c
@@ -667,7 +667,7 @@ static void
 view_set_datasource_string (WView *view, const char *s)
 {
     view->datasource = DS_STRING;
-    view->ds_string_data = (byte *) mhl_str_dup (s);
+    view->ds_string_data = (byte *) g_strdup (s);
     view->ds_string_len  = strlen (s);
 }
 
@@ -1395,8 +1395,8 @@ view_toggle_magic_mode (WView *view)
 
     altered_magic_flag = 1;
     view->magic_mode = !view->magic_mode;
-    filename = mhl_str_dup (view->filename);
-    command = mhl_str_dup (view->command);
+    filename = g_strdup (view->filename);
+    command = g_strdup (view->command);
 
     view_done (view);
     view_load (view, command, filename, 0);
@@ -1502,7 +1502,7 @@ view_load (WView *view, const char *command, const char *file,
 
     /* Set up the state */
     view_set_datasource_none (view);
-    view->filename = mhl_str_dup (file);
+    view->filename = g_strdup (file);
     view->command = 0;
 
     /* Clear the markers */
@@ -1556,7 +1556,7 @@ view_load (WView *view, const char *command, const char *file,
     }
 
   finish:
-    view->command = mhl_str_dup (command);
+    view->command = g_strdup (command);
     view->dpy_start = 0;
     view->search_start = 0;
     view->search_length = 0;
@@ -2170,7 +2170,7 @@ view_hexedit_save_changes (WView *view)
     }
 
     if (mc_close (fp) == -1) {
-	error = mhl_str_dup (strerror (errno));
+	error = g_strdup (strerror (errno));
 	message (D_ERROR, _(" Save file "),
 	    _(" Error while closing the file: \n %s \n"
 	      " Data may have been written or not. "), error);
@@ -2180,7 +2180,7 @@ view_hexedit_save_changes (WView *view)
     return TRUE;
 
   save_error:
-    error = mhl_str_dup (strerror (errno));
+    error = g_strdup (strerror (errno));
     text = g_strdup_printf (_(" Cannot save file: \n %s "), error);
     g_free (error);
     (void) mc_close (fp);
@@ -2654,7 +2654,7 @@ regexp_view_search (WView *view, char *pattern, char *string,
 	    message (D_ERROR, MSG_ERROR, _(" Invalid regular expression "));
 	    return -1;
 	}
-	old_pattern = mhl_str_dup (pattern);
+	old_pattern = g_strdup (pattern);
 	old_type = match_type;
     }
     if (regexec (&r, string, 1, pmatch, 0) != 0)
@@ -2849,7 +2849,7 @@ view_normal_search_cmd (WView *view)
 	"[Input Line Keys]", quick_widgets, 0
     };
 
-    defval = mhl_str_dup (last_search_string != NULL ? last_search_string : "");
+    defval = g_strdup (last_search_string != NULL ? last_search_string : "");
     convert_to_display (defval);
 
     quick_widgets[2].result = &treplace_backwards;
diff --git a/src/widget.c b/src/widget.c
index 9a6eb19..ff41515 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -264,7 +264,7 @@ button_new (int y, int x, int action, int flags, const char *text,
     b->action = action;
     b->flags  = flags;
     b->selected = 0;
-    b->text   = mhl_str_dup (text);
+    b->text   = g_strdup (text);
     b->callback = callback;
     widget_want_hotkey (b->widget, 1);
     b->hotkey = 0;
@@ -284,7 +284,7 @@ void
 button_set_text (WButton *b, const char *text)
 {
     g_free (b->text);
-    b->text = mhl_str_dup (text);
+    b->text = g_strdup (text);
     b->widget.cols = button_len (text, b->flags);
     button_scan_hotkey(b);
     dlg_redraw (b->widget.parent);
@@ -514,7 +514,7 @@ check_new (int y, int x, int state, const char *text)
     init_widget (&c->widget, y, x, 1, strlen (text),
 	check_callback, check_event);
     c->state = state ? C_BOOL : 0;
-    c->text = mhl_str_dup (text);
+    c->text = g_strdup (text);
     c->hotkey = 0;
     c->hotpos = -1;
     widget_want_hotkey (c->widget, 1);
@@ -607,7 +607,7 @@ label_set_text (WLabel *label, const char *text)
     g_free (label->text);
 
     if (text){
-	label->text = mhl_str_dup (text);
+	label->text = g_strdup (text);
 	if (label->auto_adjust_cols) {
 	    newcols = strlen (text);
 	    if (newcols > label->widget.cols)
@@ -637,7 +637,7 @@ label_new (int y, int x, const char *text)
 
     l = g_new (WLabel, 1);
     init_widget (&l->widget, y, x, 1, width, label_callback, NULL);
-    l->text = text ? mhl_str_dup (text) : 0;
+    l->text = text ? g_strdup (text) : 0;
     l->auto_adjust_cols = 1;
     l->transparent = 0;
     widget_want_cursor (l->widget, 0);
@@ -878,7 +878,7 @@ history_get (const char *input_name)
 	if (!*this_entry)
 	    break;
 
-	hist = list_append_unique (hist, mhl_str_dup (this_entry));
+	hist = list_append_unique (hist, g_strdup (this_entry));
     }
     g_free (profile);
 
@@ -1041,7 +1041,7 @@ show_hist (GList *history, int widget_x, int widget_y)
     if (query_dlg->ret_value != B_CANCEL) {
 	listbox_get_current (query_list, &q, NULL);
 	if (q)
-	    r = mhl_str_dup (q);
+	    r = g_strdup (q);
     }
     destroy_dlg (query_dlg);
     return r;
@@ -1130,7 +1130,7 @@ push_history (WInput *in, const char *text)
 	    return 1;
     }
 
-    t = mhl_str_dup (text);
+    t = g_strdup (text);
 
     if (in->history_name) {
 	p = in->history_name + 3;
@@ -1383,7 +1383,7 @@ static void
 kill_line (WInput *in)
 {
     g_free (kill_buffer);
-    kill_buffer = mhl_str_dup (&in->buffer [in->point]);
+    kill_buffer = g_strdup (&in->buffer [in->point]);
     in->buffer [in->point] = 0;
 }
 
@@ -1392,7 +1392,7 @@ assign_text (WInput *in, const char *text)
 {
     free_completions (in);
     g_free (in->buffer);
-    in->buffer = mhl_str_dup (text);	/* was in->buffer->text */
+    in->buffer = g_strdup (text);	/* was in->buffer->text */
     in->current_max_len = strlen (in->buffer) + 1;
     in->point = strlen (in->buffer);
     in->mark = 0;
@@ -1673,7 +1673,7 @@ input_new (int y, int x, int color, int len, const char *def_text,
     in->history_name = 0;
     if (histname) {
 	if (*histname) {
-	    in->history_name = mhl_str_dup (histname);
+	    in->history_name = g_strdup (histname);
 	    in->history = history_get (histname);
 	}
     }
@@ -2235,7 +2235,7 @@ listbox_add_item (WListbox *l, enum append_pos pos, int hotkey,
 	    return NULL;
 	    
     entry = g_new (WLEntry, 1);
-    entry->text = mhl_str_dup (text);
+    entry->text = g_strdup (text);
     entry->data = data;
     entry->hotkey = hotkey;
 
@@ -2387,7 +2387,7 @@ set_label_text (WButtonBar * bb, int index, const char *text)
 {
     g_free (bb->labels[index - 1].text);
 
-    bb->labels[index - 1].text = mhl_str_dup (text);
+    bb->labels[index - 1].text = g_strdup (text);
 }
 
 /* Find ButtonBar widget in the dialog */
@@ -2505,7 +2505,7 @@ groupbox_new (int x, int y, int width, int height, const char *title)
     /* Strip existing spaces, add one space before and after the title */
     if (title) {
 	char *t;
-	t = g_strstrip (mhl_str_dup (title));
+	t = g_strstrip (g_strdup (title));
 	g->title = g_strconcat (" ", t, " ", (char *) NULL);
 	g_free (t);
     }
diff --git a/src/wtools.c b/src/wtools.c
index 295adfa..c9b8ba8 100644
--- a/src/wtools.c
+++ b/src/wtools.c
@@ -408,7 +408,7 @@ quick_dialog_skip (QuickDialog *qd, int nskip)
 		    *qw->str_result =
 			tilde_expand (((WInput *) w)->buffer);
 		else
-		    *qw->str_result = mhl_str_dup (((WInput *) w)->buffer);
+		    *qw->str_result = g_strdup (((WInput *) w)->buffer);
 		break;
 	    }
 	}
@@ -501,7 +501,7 @@ fg_input_dialog_help (const char *header, const char *text, const char *help,
     Quick_input.title = header;
     Quick_input.help = help;
     Quick_input.i18n = 1; /* The dialog is already translated. */
-    p_text = g_strstrip (mhl_str_dup (text));
+    p_text = g_strstrip (g_strdup (text));
     quick_widgets[INPUT_INDEX + 1].text = p_text;
     quick_widgets[INPUT_INDEX].text = def_text;
 
diff --git a/vfs/cpio.c b/vfs/cpio.c
index ee1a7da..42e8f11 100644
--- a/vfs/cpio.c
+++ b/vfs/cpio.c
@@ -165,7 +165,7 @@ cpio_open_cpio_file (struct vfs_class *me, struct vfs_s_super *super,
 	return -1;
     }
 
-    super->name = mhl_str_dup (name);
+    super->name = g_strdup (name);
     super->u.arch.fd = -1;	/* for now */
     mc_stat (name, &(super->u.arch.st));
     super->u.arch.type = CPIO_UNKNOWN;
diff --git a/vfs/direntry.c b/vfs/direntry.c
index 6c4c55a..227739d 100644
--- a/vfs/direntry.c
+++ b/vfs/direntry.c
@@ -77,7 +77,7 @@ vfs_s_new_entry (struct vfs_class *me, const char *name, struct vfs_s_inode *ino
     total_entries++;
 
     if (name)
-	entry->name = mhl_str_dup (name);
+	entry->name = g_strdup (name);
 
     entry->ino = inode;
     entry->ino->ent = entry;
@@ -252,7 +252,7 @@ vfs_s_find_entry_tree (struct vfs_class *me, struct vfs_s_inode *root,
 {
     size_t pseg;
     struct vfs_s_entry *ent = NULL;
-    char * const pathref = mhl_str_dup (a_path);
+    char * const pathref = g_strdup (a_path);
     char *path = pathref;
 
     canonicalize_pathname (path);
@@ -322,7 +322,7 @@ vfs_s_find_entry_linear (struct vfs_class *me, struct vfs_s_inode *root,
 			 const char *a_path, int follow, int flags)
 {
     struct vfs_s_entry *ent = NULL;
-    char * const path = mhl_str_dup (a_path);
+    char * const path = g_strdup (a_path);
     struct vfs_s_entry *retval = NULL;
 
     if (root->super->root != root)
@@ -523,8 +523,8 @@ vfs_s_get_path (struct vfs_class *me, const char *inname,
 {
     char *buf, *retval;
 
-    buf = mhl_str_dup (inname);
-    retval = mhl_str_dup (vfs_s_get_path_mangle (me, buf, archive, flags));
+    buf = g_strdup (inname);
+    retval = g_strdup (vfs_s_get_path_mangle (me, buf, archive, flags));
     g_free (buf);
     return retval;
 }
@@ -547,7 +547,7 @@ vfs_s_fullpath (struct vfs_class *me, struct vfs_s_inode *ino)
     if (!(MEDATA->flags & VFS_S_REMOTE)) {
 	/* archives */
 	char *newpath;
-	char *path = mhl_str_dup (ino->ent->name);
+	char *path = g_strdup (ino->ent->name);
 	while (1) {
 	    ino = ino->ent->dir;
 	    if (ino == ino->super->root)
@@ -561,7 +561,7 @@ vfs_s_fullpath (struct vfs_class *me, struct vfs_s_inode *ino)
 
     /* remote systems */
     if ((!ino->ent->dir) || (!ino->ent->dir->ent))
-	return mhl_str_dup (ino->ent->name);
+	return g_strdup (ino->ent->name);
 
     return g_strconcat (ino->ent->dir->ent->name, PATH_SEP_STR,
 			ino->ent->name, (char *) NULL);
@@ -1037,7 +1037,7 @@ vfs_s_getlocalcopy (struct vfs_class *me, const char *path)
     if (!fh || !fh->ino || !fh->ino->localname)
 	return NULL;
 
-    local = mhl_str_dup (fh->ino->localname);
+    local = g_strdup (fh->ino->localname);
     vfs_s_close (fh);
     return local;
 }
diff --git a/vfs/extfs.c b/vfs/extfs.c
index f966b82..ded60e1 100644
--- a/vfs/extfs.c
+++ b/vfs/extfs.c
@@ -138,7 +138,7 @@ static void extfs_make_dots (struct entry *ent)
     struct inode *inode = ent->inode, *parent;
     
     parent = (parentry != NULL) ? parentry->inode : NULL;
-    entry->name = mhl_str_dup (".");
+    entry->name = g_strdup (".");
     entry->inode = inode;
     entry->dir = ent;
     inode->local_filename = NULL;
@@ -146,7 +146,7 @@ static void extfs_make_dots (struct entry *ent)
     inode->nlink++;
     entry->next_in_dir = g_new (struct entry, 1);
     entry = entry->next_in_dir;
-    entry->name = mhl_str_dup ("..");
+    entry->name = g_strdup ("..");
     inode->last_in_subdir = entry;
     entry->next_in_dir = NULL;
     if (parent != NULL) {
@@ -170,7 +170,7 @@ static struct entry *extfs_generate_entry (struct archive *archive,
     parent = (parentry != NULL) ? parentry->inode : NULL;
     entry = g_new (struct entry, 1);
     
-    entry->name = mhl_str_dup (name);
+    entry->name = g_strdup (name);
     entry->next_in_dir = NULL;
     entry->dir = parentry;
     if (parent != NULL) {
@@ -273,7 +273,7 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc)
 
     current_archive = g_new (struct archive, 1);
     current_archive->fstype = fstype;
-    current_archive->name = name ? mhl_str_dup (name) : NULL;
+    current_archive->name = name ? g_strdup (name) : NULL;
     current_archive->local_name = local_name;
 
     if (local_name != NULL)
@@ -362,7 +362,7 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc)
 		    return -1;
 		}
 		entry = g_new (struct entry, 1);
-		entry->name = mhl_str_dup (p);
+		entry->name = g_strdup (p);
 		entry->next_in_dir = NULL;
 		entry->dir = pent;
 		if (pent->inode->last_in_subdir) {
@@ -494,11 +494,11 @@ static char *
 extfs_get_path (struct vfs_class *me, const char *inname, struct archive **archive,
 		int do_not_open)
 {
-    char *buf = mhl_str_dup (inname);
+    char *buf = g_strdup (inname);
     char *res = extfs_get_path_mangle (me, buf, archive, do_not_open);
     char *res2 = NULL;
     if (res)
-	res2 = mhl_str_dup (res);
+	res2 = g_strdup (res);
     g_free (buf);
     return res2;
 }
@@ -523,7 +523,7 @@ static char *extfs_get_path_from_entry (struct entry *entry)
     }
 
     if (len == 0)
-	return mhl_str_dup ("");
+	return g_strdup ("");
     
     localpath = g_malloc (len);
     *localpath = '\0';
@@ -948,7 +948,7 @@ extfs_internal_stat (struct vfs_class *me, const char *path, struct stat *buf,
     struct archive *archive;
     char *q;
     struct entry *entry;
-    char *path2 = mhl_str_dup (path);
+    char *path2 = g_strdup (path);
     int result = -1;
 
     if ((q = extfs_get_path_mangle (me, path2, &archive, 0)) == NULL)
@@ -990,7 +990,7 @@ extfs_readlink (struct vfs_class *me, const char *path, char *buf, size_t size)
     char *q;
     size_t len;
     struct entry *entry;
-    char *mpath = mhl_str_dup (path);
+    char *mpath = g_strdup (path);
     int result = -1;
 
     if ((q = extfs_get_path_mangle (me, mpath, &archive, 0)) == NULL)
@@ -1031,7 +1031,7 @@ static ssize_t extfs_write (void *data, const char *buf, int nbyte)
 static int extfs_unlink (struct vfs_class *me, const char *file)
 {
     struct archive *archive;
-    char *q, *mpath = mhl_str_dup (file);
+    char *q, *mpath = g_strdup (file);
     struct entry *entry;
     int result = -1;
 
@@ -1060,7 +1060,7 @@ cleanup:
 static int extfs_mkdir (struct vfs_class *me, const char *path, mode_t mode)
 {
     struct archive *archive;
-    char *q, *mpath = mhl_str_dup(path);
+    char *q, *mpath = g_strdup(path);
     struct entry *entry;
     int result = -1;
 
@@ -1097,7 +1097,7 @@ cleanup:
 static int extfs_rmdir (struct vfs_class *me, const char *path)
 {
     struct archive *archive;
-    char *q, *mpath = mhl_str_dup(path);
+    char *q, *mpath = g_strdup(path);
     struct entry *entry;
     int result = -1;
 
@@ -1263,7 +1263,7 @@ extfs_getlocalcopy (struct vfs_class *me, const char *path)
 	extfs_close ((void *) fp);
 	return NULL;
     }
-    p = mhl_str_dup (fp->entry->inode->local_filename);
+    p = g_strdup (fp->entry->inode->local_filename);
     fp->archive->fd_usage++;
     extfs_close ((void *) fp);
     return p;
@@ -1340,7 +1340,7 @@ static int extfs_init (struct vfs_class *me)
 	if (!(*key))
 	    continue;
 
-	extfs_prefixes [extfs_no++] = mhl_str_dup (key);
+	extfs_prefixes [extfs_no++] = g_strdup (key);
     }
     fclose(cfg);
     g_free (mc_extfsini);
diff --git a/vfs/fish.c b/vfs/fish.c
index 8eb387e..cd607fb 100644
--- a/vfs/fish.c
+++ b/vfs/fish.c
@@ -36,11 +36,8 @@
 /* Define this if your ssh can take -I option */
 
 #include <config.h>
-
 #include <errno.h>
 
-#include <mhl/string.h>
-
 #include "../src/global.h"
 #include "../src/tty.h"		/* enable/disable interrupt key */
 #include "../src/wtools.h"	/* message() */
@@ -306,7 +303,7 @@ fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
     super->name =
 	g_strconcat ("/#sh:", SUP.user, "@", SUP.host, "/", (char *) NULL);
 #endif
-    super->name = mhl_str_dup (PATH_SEP_STR);
+    super->name = g_strdup (PATH_SEP_STR);
 
     super->root =
 	vfs_s_new_inode (me, super,
@@ -598,7 +595,7 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
     reply_code = fish_decode_reply(buffer + 4, 0);
     if (reply_code == COMPLETE) {
 	g_free (SUP.cwdir);
-	SUP.cwdir = mhl_str_dup (remote_path);
+	SUP.cwdir = g_strdup (remote_path);
 	print_vfs_message (_("%s: done."), me->name);
 	return 0;
     } else if (reply_code == ERROR) {
@@ -925,11 +922,11 @@ static int fish_##name (struct vfs_class *me, const char *path1, const char *pat
     const char *crpath1, *crpath2; \
     char *mpath1, *mpath2; \
     struct vfs_s_super *super1, *super2; \
-    if (!(crpath1 = vfs_s_get_path_mangle (me, mpath1 = mhl_str_dup(path1), &super1, 0))) { \
+    if (!(crpath1 = vfs_s_get_path_mangle (me, mpath1 = g_strdup(path1), &super1, 0))) { \
 	g_free (mpath1); \
 	return -1; \
     } \
-    if (!(crpath2 = vfs_s_get_path_mangle (me, mpath2 = mhl_str_dup(path2), &super2, 0))) { \
+    if (!(crpath2 = vfs_s_get_path_mangle (me, mpath2 = g_strdup(path2), &super2, 0))) { \
 	g_free (mpath1); \
 	g_free (mpath2); \
     } \
diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c
index 183e277..796e7df 100644
--- a/vfs/ftpfs.c
+++ b/vfs/ftpfs.c
@@ -175,7 +175,7 @@ static char *
 ftpfs_translate_path (struct vfs_class *me, struct vfs_s_super *super, const char *remote_path)
 {
     if (!SUP.remote_is_amiga)
-	return mhl_str_dup (remote_path);
+	return g_strdup (remote_path);
     else {
 	char *ret, *p;
 
@@ -193,9 +193,9 @@ ftpfs_translate_path (struct vfs_class *me, struct vfs_s_super *super, const cha
 	 * invalid.
 	 */
         if (*remote_path == '\0')
-	    return mhl_str_dup ("."); 
+	    return g_strdup ("."); 
 
-	ret = mhl_str_dup (remote_path);
+	ret = g_strdup (remote_path);
 
 	/* replace first occurance of ":/" with ":" */
 	if ((p = strchr (ret, ':')) && *(p + 1) == '/')
@@ -236,7 +236,7 @@ ftpfs_split_url(char *path, char **host, char **user, int *port, char **pass)
 	if (use_netrc)
 	    ftpfs_netrc_lookup (*host, user, pass);
 	if (!*user)
-	    *user = mhl_str_dup ("anonymous");
+	    *user = g_strdup ("anonymous");
     }
 
     /* Look up password in netrc for known user */
@@ -444,13 +444,13 @@ ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super,
     SUP.isbinary = TYPE_UNKNOWN;
 
     if (SUP.password)		/* explicit password */
-	op = mhl_str_dup (SUP.password);
+	op = g_strdup (SUP.password);
     else if (netrcpass)		/* password from netrc */
-	op = mhl_str_dup (netrcpass);
+	op = g_strdup (netrcpass);
     else if (!strcmp (SUP.user, "anonymous") || !strcmp (SUP.user, "ftp")) {
 	if (!ftpfs_anonymous_passwd)	/* default anonymous password */
 	    ftpfs_init_passwd ();
-	op = mhl_str_dup (ftpfs_anonymous_passwd);
+	op = g_strdup (ftpfs_anonymous_passwd);
 	anon = 1;
     } else {			/* ask user */
 	char *p;
@@ -461,7 +461,7 @@ ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super,
 	g_free (p);
 	if (op == NULL)
 	    ERRNOR (EPERM, 0);
-	SUP.password = mhl_str_dup (op);
+	SUP.password = g_strdup (op);
     }
 
     if (!anon || MEDATA->logfile)
@@ -478,7 +478,7 @@ ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super,
 			 SUP.host[0] == '!' ? SUP.host + 1 : SUP.host,
 			 NULL);
     } else
-	name = mhl_str_dup (SUP.user);
+	name = g_strdup (SUP.user);
 
     if (ftpfs_get_reply
 	(me, SUP.sock, reply_string,
@@ -574,7 +574,7 @@ ftpfs_load_no_proxy_list (void)
 	    *p = '\0';
 	    
 	    np = g_new (struct no_proxy_entry, 1);
-	    np->domain = mhl_str_dup (s);
+	    np->domain = g_strdup (s);
 	    np->next   = NULL;
 	    if (no_proxy)
 		current->next = np;
@@ -767,7 +767,7 @@ ftpfs_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
     
     SUP.cwdir = ftpfs_get_current_directory (me, super);
     if (!SUP.cwdir)
-        SUP.cwdir = mhl_str_dup (PATH_SEP_STR);
+        SUP.cwdir = g_strdup (PATH_SEP_STR);
     return 0;
 }
 
@@ -794,7 +794,7 @@ ftpfs_open_archive (struct vfs_class *me, struct vfs_s_super *super,
     SUP.strict = ftpfs_use_unix_list_options ? RFC_AUTODETECT : RFC_STRICT;
     SUP.isbinary = TYPE_UNKNOWN;
     SUP.remote_is_amiga = 0;
-    super->name = mhl_str_dup ("/");
+    super->name = g_strdup ("/");
     super->root =
 	vfs_s_new_inode (me, super,
 			 vfs_s_default_stat (me, S_IFDIR | 0755));
@@ -845,7 +845,7 @@ ftpfs_get_current_directory (struct vfs_class *me, struct vfs_s_super *super)
 		            *bufq = 0;
 		        }
 			if (*bufp == '/')
-			    return mhl_str_dup (bufp);
+			    return g_strdup (bufp);
 			else {
 			    /* If the remote server is an Amiga a leading slash
 			       might be missing. MC needs it because it is used
@@ -1480,7 +1480,7 @@ static int
 ftpfs_send_command(struct vfs_class *me, const char *filename, const char *cmd, int flags)
 {
     const char *rpath;
-    char *p, *mpath = mhl_str_dup(filename);
+    char *p, *mpath = g_strdup(filename);
     struct vfs_s_super *super;
     int r;
     int flush_directory_cache = (flags & OPT_FLUSH);
@@ -1522,7 +1522,7 @@ ftpfs_init_passwd(void)
      * - We don't want to let ftp sites to discriminate by the user,
      *   host or country.
      */
-    ftpfs_anonymous_passwd = mhl_str_dup ("anonymous@");
+    ftpfs_anonymous_passwd = g_strdup ("anonymous@");
 }
 
 static int ftpfs_chmod (struct vfs_class *me, const char *path, int mode)
@@ -1584,7 +1584,7 @@ ftpfs_chdir_internal (struct vfs_class *me, struct vfs_s_super *super, const cha
 	ftpfs_errno = EIO;
     } else {
 	g_free(SUP.cwdir);
-	SUP.cwdir = mhl_str_dup (remote_path);
+	SUP.cwdir = g_strdup (remote_path);
 	SUP.cwd_deferred = 0;
     }
     return r;
@@ -1881,9 +1881,9 @@ static int ftpfs_netrc_lookup (const char *host, char **login, char **pass)
     for (rupp = rup_cache; rupp != NULL; rupp = rupp->next) {
 	if (!strcmp (host, rupp->host)) {
 	    if (rupp->login)
-		*login = mhl_str_dup (rupp->login);
+		*login = g_strdup (rupp->login);
 	    if (pass && rupp->pass)
-		*pass = mhl_str_dup (rupp->pass);
+		*pass = g_strdup (rupp->pass);
 	    return 0;
 	}
     }
@@ -1924,7 +1924,7 @@ static int ftpfs_netrc_lookup (const char *host, char **login, char **pass)
 	    }
 
 	    /* We have login name now */
-	    *login = mhl_str_dup (buffer);
+	    *login = g_strdup (buffer);
 	    break;
 
 	case NETRC_PASSWORD:
@@ -1943,7 +1943,7 @@ static int ftpfs_netrc_lookup (const char *host, char **login, char **pass)
 
 	    /* Remember password.  pass may be NULL, so use tmp_pass */
 	    if (tmp_pass == NULL)
-		tmp_pass = mhl_str_dup (buffer);
+		tmp_pass = g_strdup (buffer);
 	    break;
 
 	case NETRC_ACCOUNT:
@@ -1971,14 +1971,14 @@ static int ftpfs_netrc_lookup (const char *host, char **login, char **pass)
     g_free (netrcname);
 
     rupp = g_new (struct rupcache, 1);
-    rupp->host = mhl_str_dup (host);
+    rupp->host = g_strdup (host);
     rupp->login = rupp->pass = 0;
 
     if (*login != NULL) {
-	rupp->login = mhl_str_dup (*login);
+	rupp->login = g_strdup (*login);
     }
     if (tmp_pass != NULL)
-	rupp->pass = mhl_str_dup (tmp_pass);
+	rupp->pass = g_strdup (tmp_pass);
     rupp->next = rup_cache;
     rup_cache = rupp;
 
diff --git a/vfs/local.c b/vfs/local.c
index 015037b..0185285 100644
--- a/vfs/local.c
+++ b/vfs/local.c
@@ -273,7 +273,7 @@ local_getlocalcopy (struct vfs_class *me, const char *path)
 {
     (void) me;
 
-    return mhl_str_dup (path);
+    return g_strdup (path);
 }
 
 static int
diff --git a/vfs/mcfs.c b/vfs/mcfs.c
index dde1b45..27a0cfb 100644
--- a/vfs/mcfs.c
+++ b/vfs/mcfs.c
@@ -49,8 +49,6 @@
 #endif
 #endif
 
-#include <mhl/string.h>
-
 #include "../src/global.h"
 #include "../src/tty.h"		/* enable/disable interrupt key */
 #include "../src/wtools.h"	/* message() */
@@ -161,7 +159,7 @@ mcfs_login_server (int my_socket, char *user, int port,
 	    }
 	}
 	if (netrcpass != NULL)
-	    pass = mhl_str_dup (netrcpass);
+	    pass = g_strdup (netrcpass);
 	else
 	    pass = vfs_get_password (_(" MCFS Password required "));
 	if (!pass) {
@@ -343,8 +341,8 @@ mcfs_open_link (char *host, char *user, int *port, char *netrcpass)
 
     bucket = mcfs_get_free_bucket ();
     mcfs_open_connections++;
-    bucket->host = mhl_str_dup (host);
-    bucket->user = mhl_str_dup (user);
+    bucket->host = g_strdup (host);
+    bucket->user = g_strdup (user);
     bucket->home = 0;
     bucket->port = *port;
     bucket->sock = sock;
@@ -511,13 +509,13 @@ mcfs_gethome (mcfs_connection *mc)
     char *buffer;
 
     if (mc->home)
-	return mhl_str_dup (mc->home);
+	return g_strdup (mc->home);
     else {
 	rpc_send (mc->sock, RPC_INT, MC_GETHOME, RPC_END);
 	if (0 == rpc_get (mc->sock, RPC_STRING, &buffer, RPC_END))
-	    return mhl_str_dup (PATH_SEP_STR);
+	    return g_strdup (PATH_SEP_STR);
 	mc->home = buffer;
-	return mhl_str_dup (buffer);
+	return g_strdup (buffer);
     }
 }
 
diff --git a/vfs/sfs.c b/vfs/sfs.c
index b9df1ad..234dca0 100644
--- a/vfs/sfs.c
+++ b/vfs/sfs.c
@@ -77,7 +77,7 @@ sfs_vfmake (struct vfs_class *me, const char *name, char *cache)
     char *pname;	/* name of parent archive */
     char *pqname;	/* name of parent archive, quoted */
 
-    pname = mhl_str_dup (name);
+    pname = g_strdup (name);
     vfs_split (pname, &inpath, &op);
     if ((w = (*me->which) (me, op)) == -1)
 	vfs_die ("This cannot happen... Hopefully.\n");
@@ -183,7 +183,7 @@ sfs_redirect (struct vfs_class *me, const char *name)
 
     if (!sfs_vfmake (me, name, cache)) {
 	cur = g_new (struct cachedfile, 1);
-	cur->name = mhl_str_dup (name);
+	cur->name = g_strdup (name);
 	cur->cache = cache;
 	cur->next = head;
 	head = cur;
@@ -317,7 +317,7 @@ static char *
 sfs_getlocalcopy (struct vfs_class *me, const char *path)
 {
     path = sfs_redirect (me, path);
-    return mhl_str_dup (path);
+    return g_strdup (path);
 }
 
 static int
@@ -392,8 +392,8 @@ static int sfs_init (struct vfs_class *me)
 	if ((semi = strchr (c, '\n')))
 	    *semi = 0;
 
-	sfs_prefix [sfs_no] = mhl_str_dup (key);
-	sfs_command [sfs_no] = mhl_str_dup (c);
+	sfs_prefix [sfs_no] = g_strdup (key);
+	sfs_command [sfs_no] = g_strdup (c);
 	sfs_flags [sfs_no] = flags;
 	sfs_no++;
     }
diff --git a/vfs/smbfs.c b/vfs/smbfs.c
index a4e5050..809c37a 100644
--- a/vfs/smbfs.c
+++ b/vfs/smbfs.c
@@ -112,7 +112,7 @@ typedef struct {
 static GSList *auth_list;
 
 /* this function allows you to write:
- * char *s = mhl_str_dup("hello, world");
+ * char *s = g_strdup("hello, world");
  * s = free_after(g_strconcat(s, s, (char *)0), s);
  */
 static inline char *
@@ -182,12 +182,12 @@ smbfs_auth_add (const char *host, const char *share, const char *domain,
     if (!auth)
         return;
 
-    /* Don't check for NULL, mhl_str_dup already does. */
-    auth->host = mhl_str_dup (host);
-    auth->share = mhl_str_dup (share);
-    auth->domain = mhl_str_dup (domain);
-    auth->user = mhl_str_dup (user);
-    auth->password = mhl_str_dup (password);
+    /* Don't check for NULL, g_strdup already does. */
+    auth->host = g_strdup (host);
+    auth->share = g_strdup (share);
+    auth->domain = g_strdup (domain);
+    auth->user = g_strdup (user);
+    auth->password = g_strdup (password);
     auth_list = g_slist_prepend (auth_list, auth);
 }
 
@@ -198,8 +198,8 @@ smbfs_auth_remove (const char *host, const char *share)
     struct smb_authinfo *auth;
     GSList *list;
 
-    data.host = mhl_str_dup (host);
-    data.share = mhl_str_dup (share);
+    data.host = g_strdup (host);
+    data.share = g_strdup (share);
     list = g_slist_find_custom (auth_list, 
                                 &data, 
                                 smbfs_auth_cmp_host_and_share);
@@ -228,9 +228,9 @@ smbfs_bucket_set_authinfo (smbfs_connection *bucket,
         g_free (bucket->domain);
         g_free (bucket->user);
         g_free (bucket->password);
-        bucket->domain = mhl_str_dup (domain);
-        bucket->user = mhl_str_dup (user);
-        bucket->password = mhl_str_dup (pass);
+        bucket->domain = g_strdup (domain);
+        bucket->user = g_strdup (user);
+        bucket->password = g_strdup (pass);
         smbfs_auth_remove (bucket->host, bucket->service);
         smbfs_auth_add (bucket->host, bucket->service,
                   domain, user, pass);
@@ -244,16 +244,16 @@ smbfs_bucket_set_authinfo (smbfs_connection *bucket,
         list = g_slist_find_custom (auth_list, &data, smbfs_auth_cmp_host);
     if (list) {
         auth = list->data;
-        bucket->domain = mhl_str_dup (auth->domain);
-        bucket->user = mhl_str_dup (auth->user);
-        bucket->password = mhl_str_dup (auth->password);
+        bucket->domain = g_strdup (auth->domain);
+        bucket->user = g_strdup (auth->user);
+        bucket->password = g_strdup (auth->password);
         return 1;
     }
 
     if (got_pass) {
-        bucket->domain = mhl_str_dup (lp_workgroup ());
-        bucket->user = mhl_str_dup (got_user ? username : user);
-        bucket->password = mhl_str_dup (password);
+        bucket->domain = g_strdup (lp_workgroup ());
+        bucket->user = g_strdup (got_user ? username : user);
+        bucket->password = g_strdup (password);
         return 1;
     }
 
@@ -265,9 +265,9 @@ smbfs_bucket_set_authinfo (smbfs_connection *bucket,
         g_free (bucket->domain);
         g_free (bucket->user);
         g_free (bucket->password);
-        bucket->domain = mhl_str_dup (auth->domain);
-        bucket->user = mhl_str_dup (auth->user);
-        bucket->password = mhl_str_dup (auth->password);
+        bucket->domain = g_strdup (auth->domain);
+        bucket->user = g_strdup (auth->user);
+        bucket->password = g_strdup (auth->password);
         smbfs_auth_remove (bucket->host, bucket->service);
         auth_list = g_slist_prepend (auth_list, auth);
         return 1;
@@ -461,7 +461,7 @@ smbfs_new_dir_entry (const char *name)
     static int inode_counter;
     dir_entry *new_entry;
     new_entry = g_new0 (dir_entry, 1);
-    new_entry->text = dos_to_unix (mhl_str_dup (name), 1);
+    new_entry->text = dos_to_unix (g_strdup (name), 1);
 
     if (first_direntry) {
 	current_info->entries = new_entry;
@@ -603,9 +603,9 @@ smbfs_reconnect(smbfs_connection *conn, int *retries)
 	DEBUG(3, ("RECONNECT\n"));
 
 	if (*(conn->host) == 0)
-		host = mhl_str_dup(conn->cli->desthost);		/* server browsing */
+		host = g_strdup(conn->cli->desthost);		/* server browsing */
 	else
-		host = mhl_str_dup(conn->host);
+		host = g_strdup(conn->host);
 
 	cli_shutdown(conn->cli);
 
@@ -765,7 +765,7 @@ smbfs_loaddir (opendir_info *smbfs_info)
     /* do regular directory listing */
     if (strncmp (smbfs_info->conn->service, info_dirname + 1, servlen) == 0) {
 	/* strip share name from dir */
-	my_dirname = mhl_str_dup (info_dirname + servlen);
+	my_dirname = g_strdup (info_dirname + servlen);
 	*my_dirname = '/';
 	my_dirname = free_after(smbfs_convert_path (my_dirname, TRUE), my_dirname);
     } else
@@ -1034,7 +1034,7 @@ smbfs_get_master_browser(char **host)
 		if (!count)
 			return 0;
 		/* just return first master browser */
-		*host = mhl_str_dup(inet_ntoa(ip_list[0]));
+		*host = g_strdup(inet_ntoa(ip_list[0]));
 		return 1;
 	}
 	return 0;
@@ -1148,16 +1148,16 @@ smbfs_open_link (char *host, char *path, const char *user, int *port,
     }
     current_bucket = bucket;
 
-    bucket->user = mhl_str_dup (user);
-    bucket->service = mhl_str_dup (service);
+    bucket->user = g_strdup (user);
+    bucket->service = g_strdup (service);
 
     if (!(*host)) {		/* if blank host name, browse for servers */
 	if (!smbfs_get_master_browser (&host))	/* set host to ip of master browser */
 	    return 0;		/* could not find master browser? */
 	g_free (host);
-	bucket->host = mhl_str_dup ("");	/* blank host means master browser */
+	bucket->host = g_strdup ("");	/* blank host means master browser */
     } else
-	bucket->host = mhl_str_dup (host);
+	bucket->host = g_strdup (host);
 
     if (!smbfs_bucket_set_authinfo (bucket, 0,	/* domain currently not used */
 			      user, this_pass, 1))
@@ -1254,7 +1254,7 @@ smbfs_opendir (struct vfs_class *me, const char *dirname)
     /* FIXME: where freed? */
     smbfs_info = g_new (opendir_info, 1);
 	smbfs_info->server_list = FALSE;
-    smbfs_info->path = mhl_str_dup(dirname);		/* keep original */
+    smbfs_info->path = g_strdup(dirname);		/* keep original */
 	smbfs_info->dirname = remote_dir;
     smbfs_info->conn = sc;
     smbfs_info->entries = 0;
@@ -1362,7 +1362,7 @@ smbfs_get_remote_stat (smbfs_connection * sc, const char *path, struct stat *buf
 #if 0	/* single_entry is never free()d now.  And only my_stat is used */
     single_entry = g_new (dir_entry, 1);
 
-    single_entry->text = dos_to_unix (mhl_str_dup (finfo->name), 1);
+    single_entry->text = dos_to_unix (g_strdup (finfo->name), 1);
 
     single_entry->next = 0;
 #endif
@@ -1430,7 +1430,7 @@ smbfs_get_stat_info (smbfs_connection * sc, const char *path, struct stat *buf)
     {
 	char *mdp;
 	char *mydir;
-	mdp = mydir = mhl_str_dup (current_info->dirname);
+	mdp = mydir = g_strdup (current_info->dirname);
 	if ((p = strrchr (mydir, '/')))
 	    *p = 0;		/* advance util last '/' */
 	if ((p = strrchr (mydir, '/')))
@@ -1512,7 +1512,7 @@ smbfs_loaddir_by_name (struct vfs_class *me, const char *path)
 	void *info;
 	char *mypath, *p;
 
-	mypath = mhl_str_dup(path);
+	mypath = g_strdup(path);
 	p = strrchr(mypath, '/');
 
 	if (p > mypath)
diff --git a/vfs/tar.c b/vfs/tar.c
index 12a4c8f..5a65d55 100644
--- a/vfs/tar.c
+++ b/vfs/tar.c
@@ -22,14 +22,10 @@
 /* Namespace: init_tarfs */
 
 #include <config.h>
-
 #include <sys/types.h>
 #include <errno.h>
 #include <ctype.h>
 
-#include <mhl/memory.h>
-#include <mhl/string.h>
-
 #ifdef hpux
 /* major() and minor() macros (among other things) defined here for hpux */
 #include <sys/mknod.h>
@@ -231,7 +227,7 @@ tar_open_archive_int (struct vfs_class *me, const char *name,
 	ERRNOR (ENOENT, -1);
     }
 
-    archive->name = mhl_str_dup (name);
+    archive->name = g_strdup (name);
     mc_stat (name, &(archive->u.arch.st));
     archive->u.arch.fd = -1;
     archive->u.arch.type = TAR_UNKNOWN;
diff --git a/vfs/undelfs.c b/vfs/undelfs.c
index a10273f..3a4c3d8 100644
--- a/vfs/undelfs.c
+++ b/vfs/undelfs.c
@@ -143,7 +143,7 @@ undelfs_get_path (const char *dirname, char **fsname, char **file)
 	if (*p == '/'){
 	    char *tmp;
 
-	    *file = mhl_str_dup (p+1);
+	    *file = g_strdup (p+1);
 	    tmp = g_strndup (dirname, p - dirname);
 	    *fsname = g_strconcat ("/dev/", tmp, (char *) NULL);
 	    g_free (tmp);
@@ -151,7 +151,7 @@ undelfs_get_path (const char *dirname, char **fsname, char **file)
 	}
 	p--;
     }
-    *file = mhl_str_dup ("");
+    *file = g_strdup ("");
     *fsname = g_strconcat ("/dev/", dirname, (char *) NULL);
     return;
 }
diff --git a/vfs/utilvfs.c b/vfs/utilvfs.c
index 08cb3dd..adb9867 100644
--- a/vfs/utilvfs.c
+++ b/vfs/utilvfs.c
@@ -60,7 +60,7 @@ vfs_split_url (const char *path, char **host, char **user, int *port,
     struct passwd *passwd_info;
     char *dir, *colon, *inner_colon, *at, *rest;
     char *retval;
-    char * const pcopy = mhl_str_dup (path);
+    char * const pcopy = g_strdup (path);
     const char *pend = pcopy + strlen (pcopy);
 
     if (pass)
@@ -75,10 +75,10 @@ vfs_split_url (const char *path, char **host, char **user, int *port,
 	while (*dir != PATH_SEP && *dir)
 	    dir++;
 	if (*dir) {
-	    retval = mhl_str_dup (dir);
+	    retval = g_strdup (dir);
 	    *dir = 0;
 	} else
-	    retval = mhl_str_dup (PATH_SEP_STR);
+	    retval = g_strdup (PATH_SEP_STR);
     }
 
     /* search for any possible user */
@@ -92,10 +92,10 @@ vfs_split_url (const char *path, char **host, char **user, int *port,
 	    *inner_colon = 0;
 	    inner_colon++;
 	    if (pass)
-		*pass = mhl_str_dup (inner_colon);
+		*pass = g_strdup (inner_colon);
 	}
 	if (*pcopy != 0)
-	    *user = mhl_str_dup (pcopy);
+	    *user = g_strdup (pcopy);
 
 	if (pend == at + 1)
 	    rest = at;
@@ -107,10 +107,10 @@ vfs_split_url (const char *path, char **host, char **user, int *port,
     if (!*user && !(flags & URL_ALLOW_ANON)) {
 	passwd_info = getpwuid (geteuid ());
 	if (passwd_info && passwd_info->pw_name)
-	    *user = mhl_str_dup (passwd_info->pw_name);
+	    *user = g_strdup (passwd_info->pw_name);
 	else {
 	    /* This is very unlikely to happen */
-	    *user = mhl_str_dup ("anonymous");
+	    *user = g_strdup ("anonymous");
 	}
 	endpwent ();
     }
@@ -136,7 +136,7 @@ vfs_split_url (const char *path, char **host, char **user, int *port,
 	}
     }
     if (host)
-	*host = mhl_str_dup (rest);
+	*host = g_strdup (rest);
 
     g_free (pcopy);
     return retval;
@@ -748,7 +748,7 @@ vfs_parse_ls_lga (const char *p, struct stat *s, char **filename,
 	s->st_mode |= perms;
     }
 
-    p_copy = mhl_str_dup (p);
+    p_copy = g_strdup (p);
     num_cols = vfs_split_text (p_copy);
 
     s->st_nlink = atol (columns[0]);
@@ -847,7 +847,7 @@ vfs_parse_ls_lga (const char *p, struct stat *s, char **filename,
 			   column_ptr[idx2] - column_ptr[idx] - 1);
 	}
 	if (linkname) {
-	    t = mhl_str_dup (p + column_ptr[idx2 + 1]);
+	    t = g_strdup (p + column_ptr[idx2 + 1]);
 	    *linkname = t;
 	}
     } else {
@@ -856,10 +856,10 @@ vfs_parse_ls_lga (const char *p, struct stat *s, char **filename,
 	 */
 	if (filename) {
 	    /*
-	     * filename = mhl_str_dup (columns [idx++]);
+	     * filename = g_strdup (columns [idx++]);
 	     */
 
-	    t = mhl_str_dup (p + column_ptr[idx]);
+	    t = g_strdup (p + column_ptr[idx]);
 	    *filename = t;
 	}
 	if (linkname)
diff --git a/vfs/vfs.c b/vfs/vfs.c
index dba0619..6995d55 100644
--- a/vfs/vfs.c
+++ b/vfs/vfs.c
@@ -21,7 +21,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 /* Warning: funtions like extfs_lstat() have right to destroy any
- * strings you pass to them. This is acutally ok as you mhl_str_dup what
+ * strings you pass to them. This is acutally ok as you g_strdup what
  * you are passing to them, anyway; still, beware.  */
 
 /* Namespace: exports *many* functions with vfs_ prefix; exports
@@ -38,8 +38,6 @@
 #include <signal.h>
 #include <ctype.h>	/* is_digit() */
 
-#include <mhl/string.h>
-
 #include "../src/global.h"
 #include "../src/tty.h"		/* enable/disable interrupt key */
 #include "../src/wtools.h"	/* message() */
@@ -188,7 +186,7 @@ vfs_strip_suffix_from_filename (const char *filename)
     if (!filename)
 	vfs_die ("vfs_strip_suffix_from_path got NULL: impossible");
 
-    p = mhl_str_dup (filename);
+    p = g_strdup (filename);
     if (!(semi = strrchr (p, '#')))
 	return p;
 
@@ -300,7 +298,7 @@ struct vfs_class *
 vfs_get_class (const char *pathname)
 {
     struct vfs_class *vfs;
-    char *path = mhl_str_dup (pathname);
+    char *path = g_strdup (pathname);
 
     vfs = _vfs_get_class (path);
     g_free (path);
@@ -566,7 +564,7 @@ int mc_fstat (int handle, struct stat *buf) {
 
 /*
  * Return current directory.  If it's local, reread the current directory
- * from the OS.  You must mhl_str_dup() whatever this function returns.
+ * from the OS.  You must g_strdup() whatever this function returns.
  */
 static const char *
 _vfs_get_cwd (void)
@@ -596,7 +594,7 @@ _vfs_get_cwd (void)
 static void
 vfs_setup_wd (void)
 {
-    current_dir = mhl_str_dup (PATH_SEP_STR);
+    current_dir = g_strdup (PATH_SEP_STR);
     _vfs_get_cwd ();
 
     if (strlen (current_dir) > MC_MAXPATHLEN - 2)
@@ -670,7 +668,7 @@ vfs_canon (const char *path)
      * /p1/p2#op/.././././p3#op/p4. Good luck.
      */
     {
-	char *result = mhl_str_dup (path);
+	char *result = g_strdup (path);
 	canonicalize_pathname (result);
         return result;
     }
@@ -931,7 +929,7 @@ vfs_fill_names (fill_names_f func)
 
 /*
  * Returns vfs path corresponding to given url. If passed string is
- * not recognized as url, mhl_str_dup(url) is returned.
+ * not recognized as url, g_strdup(url) is returned.
  */
 
 static const struct {
@@ -955,7 +953,7 @@ vfs_translate_url (const char *url)
        if (strncmp (url, url_table[i].name, url_table[i].name_len) == 0)
            return g_strconcat (url_table[i].substitute, url + url_table[i].name_len, (char*) NULL);
 
-    return mhl_str_dup (url);
+    return g_strdup (url);
 }
 
 int vfs_file_is_local (const char *filename)

-- 
Midnight Commander Development


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]