From 0b1062471ce425497044ed30fd11a5403ccce5b6 Mon Sep 17 00:00:00 2001 From: otya128 Date: Mon, 3 Jul 2017 21:53:38 +0900 Subject: [PATCH] Fix file loading --- SMILEBASIC/project.d | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SMILEBASIC/project.d b/SMILEBASIC/project.d index e14d497..5b34e4a 100644 --- a/SMILEBASIC/project.d +++ b/SMILEBASIC/project.d @@ -119,11 +119,12 @@ r"ファイルを書き込みます。 { import std.algorithm; import std.functional; + if (project.empty) + project = convertProjectName(currentProject); if(!isValidProjectName(project)) { return null; } - if(project == "") project = "[DEFAULT]"; auto dir(wstring type) { auto path = buildPath(projectPath, project, type).to!string; @@ -156,7 +157,8 @@ r"ファイルを書き込みます。 type = type.toUpper; //TODO:case-sensitive filesystem... name = name.toUpper; - if(project == "") project = "[DEFAULT]"; + if (project.empty) + project = convertProjectName(currentProject); if(type != "TXT" && type != "DAT") { return false; @@ -206,7 +208,7 @@ r"ファイルを書き込みます。 { f.seek(0); harray[0].dimension = 1; - harray[0].dim[] = [cast(int)f.size, 0, 0, 0]; + harray[0].dim[] = [cast(int)f.size / int.sizeof, 0, 0, 0]; harray[0].type = DataType.int_; } if (harray[0].dimension != contents.dimCount)