@@ -648,6 +648,9 @@ private function doCompile($compiler_config, &$files, $dir, $CC, $CFLAGS, $CPP,
648
648
$ output = str_replace ("$ dir/ " , "" , $ output ); // XXX
649
649
$ output = $ this ->postproc ->ansi_to_html (implode ("\n" , $ output ));
650
650
651
+ $ output = $ this ->pathRemover ($ output , $ compiler_config );
652
+ $ avr_output = $ this ->pathRemover ($ avr_output , $ compiler_config );
653
+
651
654
$ resp = array (
652
655
"success " => false ,
653
656
"step " => 4 ,
@@ -1196,4 +1199,26 @@ private function cleanUpClangOutput ($clang_output, $compiler_config) {
1196
1199
return $ final ;
1197
1200
}
1198
1201
1202
+ private function pathRemover ($ output , $ compiler_config ) {
1203
+
1204
+ $ core_pattern = "/ " . str_replace ("/ " , "\\/ " , $ compiler_config ["arduino_cores_dir " ]) . "([.* \\S]* \\/) " . "/ " ;
1205
+ $ external_core_pattern = "// " ;
1206
+ if (isset ($ compiler_config ["external_core_files " ]) && $ compiler_config ["external_core_files " ] != "" )
1207
+ $ external_core_pattern = "/ " . str_replace ("/ " , "\\/ " , $ compiler_config ["external_core_files " ]) . "([.* \\S]* \\/) " . "/ " ;
1208
+
1209
+ // Remove any instance of "compiler.RANDOM/files/" folder name from the text
1210
+ $ modified = str_replace ($ compiler_config ["compiler_dir " ] . "/files/ " , '' , $ output );
1211
+
1212
+ // Remove any remaining instance of "compiler.RANDOM/" folder name from the text.
1213
+ $ modified = str_replace ($ compiler_config ["compiler_dir " ] . "/ " , '' , $ modified );
1214
+
1215
+ // Remove any instance of codebender arduino core files folder name from the text
1216
+ $ modified = preg_replace ($ core_pattern , '' , $ modified );
1217
+
1218
+ // Remove any instance of codebender external core file folder name from the text
1219
+ $ modified = preg_replace ($ external_core_pattern , '' , $ modified );
1220
+
1221
+ return $ modified ;
1222
+ }
1223
+
1199
1224
}
0 commit comments