summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2020-04-15 20:52:23 +0100
committerFreeArtMan <dos21h@gmail.com>2020-04-15 20:52:23 +0100
commitef29d288ed57250b399d6a95cf26a40d4e33794e (patch)
tree10b124d73cc6bef42fba56abdf8f65fc277bcc8e /cmd
parent6c44c2e89000444b1bdf790452fd1b92d121ed06 (diff)
downloadihe-master.tar.gz
ihe-master.zip
Open file with space in filenameHEADmaster
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cmd_open.c15
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);