hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=24235f4355f38ecd021937a3b34941ce03ee0a6a

commit 24235f4355f38ecd021937a3b34941ce03ee0a6a
Author: ChunEon Park <[email protected]>
Date:   Sat Mar 15 17:20:42 2014 +0900

    newfile - open a new file with command line specified file path.
    
    Previously, the edc file is not exists that specified on the command line,
    then the new file was opened with /tmp/.proto.edc
    
    Now, the file path will be kept with user specified.
---
 src/bin/main.c    | 2 +-
 src/bin/newfile.c | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/bin/main.c b/src/bin/main.c
index 82a49b4..49e97f8 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -406,7 +406,7 @@ args_dispatch(int argc, char **argv, char *edc_path, char 
*img_path,
      }
 
    //edc path
-   if ((argc >= 2) && ecore_file_can_read(argv[1]))
+   if ((argc >= 2) && strstr(argv[1], ".edc"))
      {
         sprintf(edc_path, "%s", argv[1]);
         default_edc = EINA_FALSE;
diff --git a/src/bin/newfile.c b/src/bin/newfile.c
index bc2633f..b9a9870 100644
--- a/src/bin/newfile.c
+++ b/src/bin/newfile.c
@@ -9,12 +9,17 @@ newfile_new(edit_data *ed, Eina_Bool init)
    char buf[PATH_MAX];
    snprintf(buf, sizeof(buf), "%s/.proto/proto.edc",
             elm_app_data_dir_get());
-   if (!init || !ecore_file_exists(config_edc_path_get()))
+   if (!init)
      {
         config_edc_path_set(PROTO_EDC_PATH);
         success = eina_file_copy(buf, config_edc_path_get(),
                                  EINA_FILE_COPY_DATA, NULL, NULL);
      }
+   else if (!ecore_file_exists(config_edc_path_get()))
+     {
+        success = eina_file_copy(buf,config_edc_path_get(),
+                                 EINA_FILE_COPY_DATA, NULL, NULL);
+     }
    if (!success)
      {
         EINA_LOG_ERR("Cannot find file! \"%s\"", buf);

-- 


Reply via email to