Skip to content

Commit 1a370d7

Browse files
author
jan
committed
Do not allow & in project names for cmd
ESP tests resulted in the following error cmd /c if exist "R:\junit-workspace\00306_esp32_WeMos_WiFi&Bluetooth_Battery\src\partitions.csv" COPY /y "R:\junit-workspace\00306_esp32_WeMos_WiFi&Bluetooth_Battery\src\partitions.csv" "R:\junit-workspace\00306_esp32_WeMos_WiFi&Bluetooth_Battery\bin\Release\partitions.csv" & was unexpected at this time.
1 parent 6c6b0aa commit 1a370d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

io.sloeber.core/src/io/sloeber/core/api/Common.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,14 @@ private static String getSloeberHome() {
109109
* allowed in Unix filenames, see Note 1 > greater than used to redirect output,
110110
* allowed in Unix filenames, see Note 1 . period or dot
111111
*
112+
* Though " and & are allowed they confuse cmd commands
113+
*
112114
* @param name
113115
* the string that needs to be checked
114116
* @return a name safe to create files or folders
115117
*/
116118
public static String makeNameCompileSafe(String name) {
117-
char[] badChars = { ' ', '/', '.', ':', '\\', '(', ')', '*', '?', '%', '|', '<', '>', ',', '-', '#', '"' };
119+
char[] badChars = { ' ', '/', '.', ':', '\\', '(', ')', '*', '?', '%', '|', '<', '>', ',', '-', '#', '"', '&' };
118120
String ret = name.trim();
119121
for (char curchar : badChars) {
120122
ret = ret.replace(curchar, '_');

0 commit comments

Comments
 (0)