[Bf-blender-cvs] [d6f4c1f0d35] soc-2020-io-performance: importer: fix \r issue for file created on windows.

Ankit Meel noreply at git.blender.org
Thu Nov 19 11:00:33 CET 2020


Commit: d6f4c1f0d35a893dad92b4e147f8cf87feb574dc
Author: Ankit Meel
Date:   Thu Nov 19 15:30:21 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rBd6f4c1f0d35a893dad92b4e147f8cf87feb574dc

importer: fix \r issue for file created on windows.

===================================================================

M	source/blender/io/wavefront_obj/importer/parser_string_utils.cc

===================================================================

diff --git a/source/blender/io/wavefront_obj/importer/parser_string_utils.cc b/source/blender/io/wavefront_obj/importer/parser_string_utils.cc
index afaa272b1dc..361752238ff 100644
--- a/source/blender/io/wavefront_obj/importer/parser_string_utils.cc
+++ b/source/blender/io/wavefront_obj/importer/parser_string_utils.cc
@@ -86,7 +86,7 @@ void split_line_key_rest(StringRef line, StringRef &r_line_key, StringRef &r_res
    * character and use it in the getline. */
   const int64_t carriage_return{r_rest_line.find_first_of('\r')};
   if (carriage_return != StringRef::not_found) {
-    r_rest_line = r_rest_line.drop_prefix(carriage_return);
+    r_rest_line = r_rest_line.substr(0, carriage_return + 1);
   }
 
   const int64_t trailing_space{r_rest_line.find_last_not_of(' ')};



More information about the Bf-blender-cvs mailing list