From bb7cb87f251fd0bc6dc27a3539383a0b056b08d0 Mon Sep 17 00:00:00 2001
From: Vit Rosin <vit_r@list.ru>
Date: Sun, 6 Dec 2009 01:52:37 +0000
Subject: [PATCH] unifying g_strconcat-call
---
edit/editcmd.c | 4 ++--
src/ext.c | 2 +-
src/file.c | 2 +-
src/hotlist.c | 6 ++----
src/screen.c | 6 +++---
src/user.c | 2 +-
src/widget.c | 2 +-
vfs/direntry.c | 5 +++--
vfs/fish.c | 3 +--
vfs/ftpfs.c | 8 ++++----
vfs/smbfs.c | 3 +--
11 files changed, 20 insertions(+), 23 deletions(-)
diff --git a/edit/editcmd.c b/edit/editcmd.c
index 7328ac8..5531338 100644
a
|
b
|
edit_save_file (WEdit *edit, const char *filename) |
366 | 366 | |
367 | 367 | if (this_save_mode == EDIT_DO_BACKUP) { |
368 | 368 | assert (option_backup_ext != NULL); |
369 | | tmp = g_strconcat (real_filename, option_backup_ext,(char *) NULL); |
| 369 | tmp = g_strconcat (real_filename, option_backup_ext, (char *) NULL); |
370 | 370 | if (mc_rename (real_filename, tmp) == -1){ |
371 | 371 | g_free(tmp); |
372 | 372 | goto error_save; |
… |
… |
int edit_save_confirm_cmd (WEdit * edit) |
836 | 836 | return 0; |
837 | 837 | |
838 | 838 | if (edit_confirm_save) { |
839 | | f = g_strconcat (_(" Confirm save file? : "), edit->filename, " ", NULL); |
| 839 | f = g_strconcat (_(" Confirm save file? : "), edit->filename, " ", (char *) NULL); |
840 | 840 | if (edit_query_dialog2 (_(" Save file "), f, _("&Save"), _("&Cancel"))){ |
841 | 841 | g_free(f); |
842 | 842 | return 0; |
diff --git a/src/ext.c b/src/ext.c
index 779e5a2..83a0ae1 100644
a
|
b
|
get_file_type_local (const char *filename, char *buf, int buflen) |
310 | 310 | int read_bytes = 0; |
311 | 311 | |
312 | 312 | char *tmp = name_quote (filename, 0); |
313 | | char *command = g_strconcat (FILE_CMD, tmp, " 2>/dev/null", (char *) 0); |
| 313 | char *command = g_strconcat (FILE_CMD, tmp, " 2>/dev/null", (char *) NULL); |
314 | 314 | FILE *f = popen (command, "r"); |
315 | 315 | |
316 | 316 | g_free (tmp); |
diff --git a/src/file.c b/src/file.c
index 4d7e3fb..cc9db77 100644
a
|
b
|
panel_operate (void *source_panel, FileOperation operation, |
1959 | 1959 | |
1960 | 1960 | v = do_background (ctx, |
1961 | 1961 | g_strconcat (op_names[operation], ": ", |
1962 | | panel->cwd, NULL)); |
| 1962 | panel->cwd, (char *) NULL)); |
1963 | 1963 | if (v == -1) { |
1964 | 1964 | message (D_ERROR, MSG_ERROR, |
1965 | 1965 | _(" Sorry, I could not put the job in background ")); |
diff --git a/src/hotlist.c b/src/hotlist.c
index af58c4f..5dc5fd2 100644
a
|
b
|
static void remove_from_hotlist (struct hotlist *entry) |
1089 | 1089 | |
1090 | 1090 | title = g_strconcat (_(" Remove: "), |
1091 | 1091 | str_trunc (entry->label, 30), |
1092 | | " ", |
1093 | | NULL); |
| 1092 | " ", (char *) NULL); |
1094 | 1093 | |
1095 | 1094 | if (safe_delete) |
1096 | 1095 | query_set_sel (1); |
… |
… |
static void remove_from_hotlist (struct hotlist *entry) |
1111 | 1110 | |
1112 | 1111 | header = g_strconcat (_(" Remove: "), |
1113 | 1112 | str_trunc (entry->label, 30), |
1114 | | " ", |
1115 | | NULL); |
| 1113 | " ", (char *) NULL); |
1116 | 1114 | result = query_dialog (header, _("\n Group not empty.\n Remove it?"), |
1117 | 1115 | D_ERROR, 2, |
1118 | 1116 | _("&Yes"), _("&No")); |
diff --git a/src/screen.c b/src/screen.c
index a5ad414..99dab51 100644
a
|
b
|
static char |
1004 | 1004 | if (semi != NULL) { |
1005 | 1005 | slash = strchr (semi, PATH_SEP); |
1006 | 1006 | if (slash != NULL) { |
1007 | | result = g_strconcat (path, "/#enc:", encoding, NULL); |
| 1007 | result = g_strconcat (path, "/#enc:", encoding, (char *) NULL); |
1008 | 1008 | } else { |
1009 | 1009 | *semi = 0; |
1010 | | result = g_strconcat (path, "/#enc:", encoding, NULL); |
| 1010 | result = g_strconcat (path, "/#enc:", encoding, (char *) NULL); |
1011 | 1011 | *semi = '#'; |
1012 | 1012 | } |
1013 | 1013 | } else { |
1014 | | result = g_strconcat (path, "/#enc:", encoding, NULL); |
| 1014 | result = g_strconcat (path, "/#enc:", encoding, (char *) NULL); |
1015 | 1015 | } |
1016 | 1016 | |
1017 | 1017 | return result; |
diff --git a/src/user.c b/src/user.c
index 10e1dbc..b7d6a16 100644
a
|
b
|
execute_menu_command (WEdit *edit_widget, const char *commands) |
702 | 702 | } else { |
703 | 703 | /* execute the command indirectly to allow execution even |
704 | 704 | * on no-exec filesystems. */ |
705 | | char *cmd = g_strconcat("/bin/sh ", file_name, (char *)NULL); |
| 705 | char *cmd = g_strconcat("/bin/sh ", file_name, (char *) NULL); |
706 | 706 | shell_execute (cmd, EXECUTE_HIDE); |
707 | 707 | g_free(cmd); |
708 | 708 | } |
diff --git a/src/widget.c b/src/widget.c
index df843c6..1590d2b 100644
a
|
b
|
button_get_text (const WButton *b) |
342 | 342 | { |
343 | 343 | if (b->text.hotkey != NULL) |
344 | 344 | return g_strconcat (b->text.start, "&", b->text.hotkey, |
345 | | b->text.end, NULL); |
| 345 | b->text.end, (char *) NULL); |
346 | 346 | else |
347 | 347 | return g_strdup (b->text.start); |
348 | 348 | } |
diff --git a/vfs/direntry.c b/vfs/direntry.c
index 80b0b12..22b4a2c 100644
a
|
b
|
vfs_s_resolve_symlink (struct vfs_class *me, struct vfs_s_entry *entry, |
237 | 237 | if (*linkname != PATH_SEP) { |
238 | 238 | char *fullpath = vfs_s_fullpath (me, entry->dir); |
239 | 239 | if (fullpath) { |
240 | | fullname = g_strconcat (fullpath, "/", linkname, NULL); |
| 240 | fullname = g_strconcat (fullpath, "/", linkname, (char *) NULL); |
241 | 241 | linkname = fullname; |
242 | 242 | g_free (fullpath); |
243 | 243 | } |
… |
… |
vfs_s_fill_names (struct vfs_class *me, fill_names_f func) |
1017 | 1017 | char *name; |
1018 | 1018 | |
1019 | 1019 | while (a){ |
1020 | | name = g_strconcat ( a->name, "#", me->prefix, "/", /* a->current_dir->name, */ NULL); |
| 1020 | name = g_strconcat ( a->name, "#", me->prefix, "/", |
| 1021 | /* a->current_dir->name, */ (char *) NULL); |
1021 | 1022 | (*func)(name); |
1022 | 1023 | g_free (name); |
1023 | 1024 | a = a->next; |
diff --git a/vfs/fish.c b/vfs/fish.c
index c256cd1..2af41b3 100644
a
|
b
|
fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) |
492 | 492 | "else\n" |
493 | 493 | "echo '### 500'\n" |
494 | 494 | "fi\n" |
495 | | , |
496 | | NULL |
| 495 | , (char *) NULL |
497 | 496 | ); |
498 | 497 | |
499 | 498 | fish_command (me, super, NONE, shell_commands, |
diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c
index b1e2e5c..7de7d6e 100644
a
|
b
|
ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super, |
473 | 473 | } else { /* ask user */ |
474 | 474 | char *p; |
475 | 475 | |
476 | | p = g_strconcat (_(" FTP: Password required for "), SUP.user, " ", |
477 | | NULL); |
| 476 | p = g_strconcat (_(" FTP: Password required for "), |
| 477 | SUP.user, " ", (char *) NULL); |
478 | 478 | op = vfs_get_password (p); |
479 | 479 | g_free (p); |
480 | 480 | if (op == NULL) |
… |
… |
ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super, |
494 | 494 | name = |
495 | 495 | g_strconcat (SUP.user, "@", |
496 | 496 | SUP.host[0] == '!' ? SUP.host + 1 : SUP.host, |
497 | | NULL); |
| 497 | (char *) NULL); |
498 | 498 | } else |
499 | 499 | name = g_strdup (SUP.user); |
500 | 500 | |
… |
… |
ftpfs_get_current_directory (struct vfs_class *me, struct vfs_s_super *super) |
888 | 888 | /* If the remote server is an Amiga a leading slash |
889 | 889 | might be missing. MC needs it because it is used |
890 | 890 | as separator between hostname and path internally. */ |
891 | | return g_strconcat( "/", bufp, NULL); |
| 891 | return g_strconcat( "/", bufp, (char *) NULL); |
892 | 892 | } |
893 | 893 | } else { |
894 | 894 | ftpfs_errno = EIO; |
diff --git a/vfs/smbfs.c b/vfs/smbfs.c
index a64405d..2d3b0c4 100644
a
|
b
|
smbfs_fill_names (struct vfs_class *me, fill_names_f func) |
368 | 368 | path = g_strconcat (URL_HEADER, |
369 | 369 | smbfs_connections[i].user, "@", |
370 | 370 | smbfs_connections[i].host, |
371 | | "/", smbfs_connections[i].service, |
372 | | NULL); |
| 371 | "/", smbfs_connections[i].service, (char *) NULL); |
373 | 372 | (*func)(path); |
374 | 373 | g_free (path); |
375 | 374 | } |