~ubuntu-branches/ubuntu/lucid/mc/lucid

« back to all changes in this revision

Viewing changes to src/user.c

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2008-09-16 10:38:59 UTC
  • mfrom: (3.1.6 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080916103859-2uwn8w61xk5mbxxq
Tags: 2:4.6.2~git20080311-4
Corrected fix for odt2txt issue (Closes: #492019) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* User Menu implementation
2
 
   Copyright (C) 1994 Miguel de Icaza, Janne Kukonlehto
 
2
   Copyright (C) 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 
3
   2006, 2007 Free Software Foundation, Inc.
3
4
   
4
5
   This program is free software; you can redistribute it and/or modify
5
6
   it under the terms of the GNU General Public License as published by
16
17
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
17
18
 
18
19
#include <config.h>
 
20
 
 
21
#include <ctype.h>
 
22
#include <errno.h>
19
23
#include <stdio.h>
20
24
#include <string.h>
21
 
#include <ctype.h>
22
 
#include <errno.h>
23
25
 
24
26
#include "global.h"
25
27
#include "tty.h"
27
29
#include "dir.h"
28
30
#include "panel.h"
29
31
#include "main.h"
30
 
#include "subshell.h"           /* for subshell_pty */
31
32
#include "user.h"
32
33
#include "layout.h"
33
34
#include "execute.h"
234
235
    case 'k':                   /* block file name */
235
236
    case 'b':                   /* block file name / strip extension */  {
236
237
            if (edit_widget) {
237
 
                char *file = g_strconcat (home_dir, BLOCK_FILE, (char *) NULL);
 
238
                char *file = g_strconcat (home_dir, PATH_SEP_STR BLOCK_FILE, (char *) NULL);
238
239
                fname = (*quote_func) (file, 0);
239
240
                g_free (file);
240
241
                return fname;
625
626
            }
626
627
        } else if (expand_prefix_found){
627
628
            expand_prefix_found = 0;
628
 
            if (isdigit ((unsigned)*commands)) {
 
629
            if (isdigit ((unsigned char) *commands)) {
629
630
                do_quote = atoi (commands);
630
 
                while (isdigit ((unsigned)*commands))
 
631
                while (isdigit ((unsigned char) *commands))
631
632
                    commands++;
632
633
            }
633
634
            if (*commands == '{')
655
656
    chmod (file_name, S_IRWXU);
656
657
    if (run_view) {
657
658
        run_view = 0;
658
 
        view (file_name, 0, &run_view, 0);
 
659
        mc_internal_viewer (file_name, NULL, &run_view, 0);
659
660
    } else {
660
 
        shell_execute (file_name, EXECUTE_HIDE);
 
661
        /* execute the command indirectly to allow execution even
 
662
         * on no-exec filesystems. */
 
663
        char *cmd = g_strconcat("/bin/sh ", file_name, (char *)NULL);
 
664
        shell_execute (cmd, EXECUTE_HIDE);
 
665
        g_free(cmd);
661
666
    }
662
667
    unlink (file_name);
663
668
    g_free (file_name);