Skip to content

Commit 0013b9e

Browse files
committed
Do not remove all path for core files in pathRemover function.
1 parent 7e54794 commit 0013b9e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Symfony/src/Codebender/CompilerBundle/Handler/CompilerHandler.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,10 +1243,10 @@ private function cleanUpClangOutput ($clang_output, $compiler_config, $option) {
12431243

12441244
private function pathRemover ($output, $compiler_config) {
12451245

1246-
$core_pattern = "/" . str_replace("/", "\\/", $compiler_config["arduino_cores_dir"]) . "([.*\\S]*\\/)" . "/";
1247-
$external_core_pattern = "//";
1248-
if (isset($compiler_config["external_core_files"]) && $compiler_config["external_core_files"] != "")
1249-
$external_core_pattern = "/" . str_replace("/", "\\/", $compiler_config["external_core_files"]) . "([.*\\S]*\\/)" . "/";
1246+
// $core_pattern = "/" . str_replace("/", "\\/", $compiler_config["arduino_cores_dir"]) . "([.*\\S]*\\/)" . "/";
1247+
// $external_core_pattern = "//";
1248+
// if (isset($compiler_config["external_core_files"]) && $compiler_config["external_core_files"] != "")
1249+
// $external_core_pattern = "/" . str_replace("/", "\\/", $compiler_config["external_core_files"]) . "([.*\\S]*\\/)" . "/";
12501250

12511251
// Remove any instance of "compiler.RANDOM/files/" folder name from the text
12521252
$modified = str_replace($compiler_config["compiler_dir"] . "/files/", '', $output);
@@ -1255,10 +1255,13 @@ private function pathRemover ($output, $compiler_config) {
12551255
$modified = str_replace($compiler_config["compiler_dir"] . "/", '', $modified);
12561256

12571257
// Remove any instance of codebender arduino core files folder name from the text
1258-
$modified = preg_replace($core_pattern, '', $modified);
1258+
// $modified = preg_replace($core_pattern, '', $modified);
1259+
$modified = preg_replace($compiler_config["arduino_cores_dir"], '', $modified);
12591260

12601261
// Remove any instance of codebender external core file folder name from the text
1261-
$modified = preg_replace($external_core_pattern, '', $modified);
1262+
// $modified = preg_replace($external_core_pattern, '', $modified);
1263+
if (isset($compiler_config["external_core_files"]) && $compiler_config["external_core_files"] != "")
1264+
$modified = preg_replace($compiler_config["external_core_files"], '', $modified);
12621265

12631266
return $modified;
12641267
}

0 commit comments

Comments
 (0)