Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2021-07-21 13:34:50 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-07-21 13:34:50 +0300
commit7bfc38a39b5b094dfa44af65a1bca227eea8bac2 (patch)
treef3d2613bb1d3391db17322158c4ee346456d6db8 /src/Storage/FileInfoParser.cpp
parenta6414fd98fc8e5d5523b430e1a11b93eadc2f7cc (diff)
Added .nc to the list of file extensions that we try to parse
Diffstat (limited to 'src/Storage/FileInfoParser.cpp')
-rw-r--r--src/Storage/FileInfoParser.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Storage/FileInfoParser.cpp b/src/Storage/FileInfoParser.cpp
index 8dc1a96e..56681ab0 100644
--- a/src/Storage/FileInfoParser.cpp
+++ b/src/Storage/FileInfoParser.cpp
@@ -79,8 +79,18 @@ GCodeResult FileInfoParser::GetFileInfo(const char *filePath, GCodeFileInfo& inf
}
// If the file is empty or not a G-Code file, we don't need to parse anything
- if (fileBeingParsed->Length() == 0 || (!StringEndsWithIgnoreCase(filePath, ".gcode") && !StringEndsWithIgnoreCase(filePath, ".g")
- && !StringEndsWithIgnoreCase(filePath, ".gco") && !StringEndsWithIgnoreCase(filePath, ".gc")))
+ constexpr const char *GcodeFileExtensions[] = { ".gcode", ".g", ".gco", ".gc", ".nc" };
+ bool isGcodeFile = false;
+ for (const char *ext : GcodeFileExtensions)
+ {
+ if (StringEndsWithIgnoreCase(filePath, ext))
+ {
+ isGcodeFile = true;
+ break;
+ }
+ }
+
+ if (fileBeingParsed->Length() == 0 || !isGcodeFile)
{
fileBeingParsed->Close();
parsedFileInfo.incomplete = false;