Ticket #1865: 1865-unifying-g_strconcat-call.patch

File 1865-unifying-g_strconcat-call.patch, 7.4 KB (added by vit_r, 14 years ago)
  • edit/editcmd.c

    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) 
    366366 
    367367    if (this_save_mode == EDIT_DO_BACKUP) { 
    368368        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); 
    370370        if (mc_rename (real_filename, tmp) == -1){ 
    371371            g_free(tmp); 
    372372            goto error_save; 
    int edit_save_confirm_cmd (WEdit * edit) 
    836836        return 0; 
    837837 
    838838    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); 
    840840        if (edit_query_dialog2 (_(" Save file "), f, _("&Save"), _("&Cancel"))){ 
    841841            g_free(f); 
    842842            return 0; 
  • src/ext.c

    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) 
    310310    int read_bytes = 0; 
    311311 
    312312    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); 
    314314    FILE *f = popen (command, "r"); 
    315315 
    316316    g_free (tmp); 
  • src/file.c

    diff --git a/src/file.c b/src/file.c
    index 4d7e3fb..cc9db77 100644
    a b panel_operate (void *source_panel, FileOperation operation, 
    19591959 
    19601960        v = do_background (ctx, 
    19611961                           g_strconcat (op_names[operation], ": ", 
    1962                                         panel->cwd, NULL)); 
     1962                                        panel->cwd, (char *) NULL)); 
    19631963        if (v == -1) { 
    19641964            message (D_ERROR, MSG_ERROR, 
    19651965                     _(" Sorry, I could not put the job in background ")); 
  • src/hotlist.c

    diff --git a/src/hotlist.c b/src/hotlist.c
    index af58c4f..5dc5fd2 100644
    a b static void remove_from_hotlist (struct hotlist *entry) 
    10891089 
    10901090        title = g_strconcat (_(" Remove: "), 
    10911091                                   str_trunc (entry->label, 30), 
    1092                                    " ", 
    1093                                    NULL); 
     1092                                   " ", (char *) NULL); 
    10941093 
    10951094        if (safe_delete) 
    10961095            query_set_sel (1); 
    static void remove_from_hotlist (struct hotlist *entry) 
    11111110 
    11121111            header = g_strconcat (_(" Remove: "), 
    11131112                                   str_trunc (entry->label, 30), 
    1114                                    " ", 
    1115                                    NULL); 
     1113                                   " ", (char *) NULL); 
    11161114            result = query_dialog (header, _("\n Group not empty.\n Remove it?"), 
    11171115                                   D_ERROR, 2, 
    11181116                                   _("&Yes"), _("&No")); 
  • src/screen.c

    diff --git a/src/screen.c b/src/screen.c
    index a5ad414..99dab51 100644
    a b static char 
    10041004    if (semi != NULL) { 
    10051005        slash = strchr (semi, PATH_SEP); 
    10061006        if (slash != NULL) { 
    1007             result = g_strconcat (path, "/#enc:", encoding, NULL); 
     1007            result = g_strconcat (path, "/#enc:", encoding, (char *) NULL); 
    10081008        } else { 
    10091009            *semi = 0; 
    1010             result = g_strconcat (path, "/#enc:", encoding, NULL); 
     1010            result = g_strconcat (path, "/#enc:", encoding, (char *) NULL); 
    10111011            *semi = '#'; 
    10121012        } 
    10131013    } else { 
    1014         result = g_strconcat (path, "/#enc:", encoding, NULL); 
     1014        result = g_strconcat (path, "/#enc:", encoding, (char *) NULL); 
    10151015    } 
    10161016 
    10171017    return result; 
  • src/user.c

    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) 
    702702    } else { 
    703703        /* execute the command indirectly to allow execution even 
    704704         * 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); 
    706706        shell_execute (cmd, EXECUTE_HIDE); 
    707707        g_free(cmd); 
    708708    } 
  • src/widget.c

    diff --git a/src/widget.c b/src/widget.c
    index df843c6..1590d2b 100644
    a b button_get_text (const WButton *b) 
    342342{ 
    343343    if (b->text.hotkey != NULL) 
    344344        return g_strconcat (b->text.start, "&", b->text.hotkey, 
    345                             b->text.end, NULL); 
     345                            b->text.end, (char *) NULL); 
    346346    else 
    347347        return g_strdup (b->text.start); 
    348348} 
  • vfs/direntry.c

    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, 
    237237    if (*linkname != PATH_SEP) { 
    238238        char *fullpath = vfs_s_fullpath (me, entry->dir); 
    239239        if (fullpath) { 
    240             fullname = g_strconcat (fullpath, "/", linkname, NULL); 
     240            fullname = g_strconcat (fullpath, "/", linkname, (char *) NULL); 
    241241            linkname = fullname; 
    242242            g_free (fullpath); 
    243243        } 
    vfs_s_fill_names (struct vfs_class *me, fill_names_f func) 
    10171017    char *name; 
    10181018     
    10191019    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); 
    10211022        (*func)(name); 
    10221023        g_free (name); 
    10231024        a = a->next; 
  • vfs/fish.c

    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) 
    492492        "else\n" 
    493493                  "echo '### 500'\n" 
    494494        "fi\n" 
    495         , 
    496         NULL 
     495        , (char *) NULL 
    497496    ); 
    498497 
    499498    fish_command (me, super, NONE, shell_commands, 
  • vfs/ftpfs.c

    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, 
    473473    } else {                    /* ask user */ 
    474474        char *p; 
    475475 
    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); 
    478478        op = vfs_get_password (p); 
    479479        g_free (p); 
    480480        if (op == NULL) 
    ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super, 
    494494        name = 
    495495            g_strconcat (SUP.user, "@", 
    496496                         SUP.host[0] == '!' ? SUP.host + 1 : SUP.host, 
    497                         NULL); 
     497                         (char *) NULL); 
    498498    } else 
    499499        name = g_strdup (SUP.user); 
    500500 
    ftpfs_get_current_directory (struct vfs_class *me, struct vfs_s_super *super) 
    888888                            /* If the remote server is an Amiga a leading slash 
    889889                               might be missing. MC needs it because it is used 
    890890                               as separator between hostname and path internally. */ 
    891                             return g_strconcat( "/", bufp, NULL); 
     891                            return g_strconcat( "/", bufp, (char *) NULL); 
    892892                        } 
    893893                    } else { 
    894894                        ftpfs_errno = EIO; 
  • vfs/smbfs.c

    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) 
    368368            path = g_strconcat (URL_HEADER, 
    369369                smbfs_connections[i].user, "@", 
    370370                smbfs_connections[i].host, 
    371                 "/", smbfs_connections[i].service, 
    372                 NULL); 
     371                "/", smbfs_connections[i].service, (char *) NULL); 
    373372            (*func)(path); 
    374373            g_free (path); 
    375374        }