codegen: ensure we include the filename and not the path
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Fri, 2 Nov 2018 11:38:02 +0000 (12:38 +0100)
committerYeongjong Lee <yj34.lee@samsung.com>
Thu, 8 Nov 2018 06:40:48 +0000 (15:40 +0900)
this mirrors the behaviour of eolian & eolian_cxx. Usally a generator
just generates the files side by side, the directory then needs to be
included anyways. thus adding the include with another subdirectory is
unusal.

Differential Revision: https://phab.enlightenment.org/D7235

src/bin/edje/edje_codegen.c
src/bin/elementary/elementary_codegen.c

index cbca138..f55c8f9 100644 (file)
@@ -13,6 +13,7 @@
 #include <Ecore.h>
 #include <Ecore_Getopt.h>
 #include <Ecore_Evas.h>
+#include <Ecore_File.h>
 
 #include "Edje.h"
 #define EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT 1
@@ -432,7 +433,7 @@ _write_headers(const char *filename)
 
    free(str);
 
-   snprintf(buf, sizeof(buf), C_HEADER, filename);
+   snprintf(buf, sizeof(buf), C_HEADER, ecore_file_file_get(filename));
    if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
      return EINA_FALSE;
 
index e9cc685..2f8324f 100644 (file)
@@ -3,6 +3,7 @@
 #endif
 
 #include <Ecore.h>
+#include <Ecore_File.h>
 #include <Ecore_Evas.h>
 #include <Ecore_Getopt.h>
 #include <Edje.h>
@@ -344,7 +345,7 @@ _headers_write(const char *filename)
 
    free(str);
 
-   snprintf(buf, sizeof(buf), C_HEADER, filename);
+   snprintf(buf, sizeof(buf), C_HEADER, ecore_file_file_get(filename));
    if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
      return EINA_FALSE;