diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/cmd_open.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cmd/cmd_open.c b/cmd/cmd_open.c index d758598..ebec8c1 100644 --- a/cmd/cmd_open.c +++ b/cmd/cmd_open.c @@ -1,5 +1,6 @@ #include "buf.h" #include "core.h" +#include "util.h" #include "libcmd/cmd.h" #include "libcmd/cmd_parse.h" @@ -16,6 +17,7 @@ int c_open( cmd_arg_t *arg ) int argc = arg->argc; char **argv = arg->argv; + int *type = arg->type; char *fname = NULL; int fret = 0; @@ -25,11 +27,20 @@ int c_open( cmd_arg_t *arg ) return -1; } - fname = argv[0]; - printf("%s\n",fname); + //fname = argv[0]; + if (type[0] == CMDT_QSTR) + { + fname = alloc_new_str(argv[0]+1); + fname[strlen(argv[0])-2] = 0x0; + } else { + fname = alloc_new_str(argv[0]); + } + + printf("fname %s\n",fname); fret = file_open_fn( g_file, fname, g_flags ); //!if failure fields could be non empty inside struct + free(fname);fname=NULL; if ( fret < 0 ) { printf("Cannot open file %s\n",fname); |