Merged revision(s) 58994-59032 from trunk/blender into soc-2013-dingto.
[blender.git] / release / datafiles / datatoc.py
index 7ad9644022299a3d1325dc06dac31927b7cb209f..f1fce08d7dd18fabb6bde28e1e113cd6d7ebc12e 100755 (executable)
@@ -45,16 +45,16 @@ fpin.seek(0, os.SEEK_END)
 size = fpin.tell()
 fpin.seek(0)
 
-if filename[0] == ".":
-    filename = filename[1:]
+if filename[0:2] == "." + os.sep:
+    filename = filename[2:]
 
 cname = filename + ".c"
 sys.stdout.write("Making C file <%s>\n" % cname)
 
 filename = filename.split("/")[-1].split("\\")[-1]
 filename = filename.replace(".", "_")
-sys.stdout.write(str(size))
-sys.stdout.write("\n")
+sys.stdout.write("%d\n" % size)
+
 try:
     fpout = open(cname, "w")
 except:
@@ -62,9 +62,9 @@ except:
     sys.exit(1)
 
 fpout.write("/* DataToC output of file <%s> */\n\n" % filename)
-fpout.write("int datatoc_%s_size= %d;\n" % (filename, size))
+fpout.write("int datatoc_%s_size = %d;\n" % (filename, size))
 
-fpout.write("char datatoc_%s[]= {\n" % filename)
+fpout.write("char datatoc_%s[] = {\n" % filename)
 
 while size > 0:
     size -= 1