Author: spitzak
Date: 2007-07-23 14:14:48 -0700 (Mon, 23 Jul 2007)
New Revision: 5935
Log:
Fix for STR #1717
Fluid by default keeps the full pathname of the .fl file and just changes
the extension when writing the output. You can force it to write any file
by setting the code/header filenames to strings that dont start with .h
(where h can be any letter), in which case it uses these literally.


Modified:
   trunk/fluid/code.cxx
   trunk/fluid/fluid.cxx

Modified: trunk/fluid/code.cxx
===================================================================
--- trunk/fluid/code.cxx        2007-07-23 20:12:39 UTC (rev 5934)
+++ trunk/fluid/code.cxx        2007-07-23 21:14:48 UTC (rev 5935)
@@ -347,10 +347,9 @@
   fprintf(header_file, "#define %s\n", define_name);
   }  
 
-  if (*t == '.' && strchr(t, '/') == NULL) {
+  if (t) {
+    // Ideally this should figure out the relative path between s and t:
     write_c("#include \"%s\"\n", filename_name(t));
-  } else {
-    write_c("#include \"%s\"\n", t);
   }
 
   for (FluidType* p = FluidType::first; p; p = p->next_brother) {

Modified: trunk/fluid/fluid.cxx
===================================================================
--- trunk/fluid/fluid.cxx       2007-07-23 20:12:39 UTC (rev 5934)
+++ trunk/fluid/fluid.cxx       2007-07-23 21:14:48 UTC (rev 5935)
@@ -676,14 +676,16 @@
     char cname[1024];
     char hname[1024];
     if (code_file_name[0] == '.' && isalpha(code_file_name[1])) {
-       strcpy(cname,filename_name(filename));
-       strcpy((char*)filename_ext(cname), code_file_name);
+       strlcpy(cname, filename, 1024);
+       *filename_ext(cname) = 0;
+       strlcat(cname, code_file_name, 1024);
     } else {
        strcpy(cname, code_file_name);
     }
     if (header_file_name[0] == '.' && isalpha(header_file_name[1])) {
-       strcpy(hname,filename_name(filename));
-       strcpy((char*)filename_ext(hname), header_file_name);
+       strlcpy(hname, filename, 1024);
+       *filename_ext(hname) = 0;
+       strlcat(hname, header_file_name, 1024);
     } else {
        strcpy(hname, header_file_name);
     }

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to