Browse Source

Appending new line character to the end of string

rsredsq 10 years ago
parent
commit
752bece0a3

+ 1 - 1
Source/Atomic/IO/File.cpp

@@ -539,7 +539,7 @@ void File::ReadText(String& text)
 
     Read((void*)text.CString(), size_);
 
-    text[size_] = '\0';
+    text[size_] = '\n';
 }
 
 // ATOMIC BEGIN

+ 1 - 2
Source/AtomicEditor/Application/AEEditorApp.cpp

@@ -158,8 +158,7 @@ void AEEditorApp::HandleJSError(StringHash eventType, VariantMap& eventData)
     String errFilename = eventData[P_ERRORFILENAME].GetString();
     //String errStack = eventData[P_ERRORSTACK].GetString();
     int errLineNumber = vm_->GetRealLineNumber("AtomicEditor/out/" + errFilename, eventData[P_ERRORLINENUMBER].GetInt());
-    //int errRealLineNumber = ;
-
+    
     String errorString = ToString("%s - %s - Line: %i", errFilename.CString(), errMessage.CString(), errLineNumber);
 
 

+ 0 - 3
Source/AtomicJS/Javascript/JSRequire.cpp

@@ -133,9 +133,6 @@ namespace Atomic
             vm->SetLastModuleSearchFile(jsfile->GetFullPath());
             String source;
             jsfile->ReadText(source);
-            //not sure if it's good solution
-            source.At(source.Length() - 1) = ' ';
-            source.Append("\n");
             duk_push_string(ctx, source.CString());
             return 1;
         }