We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c3d64c commit 6108935Copy full SHA for 6108935
src/main/java/org/scijava/plugins/scripting/matlab/MATLABScriptEngine.java
@@ -114,7 +114,12 @@ public Object eval(final Reader reader) throws ScriptException {
114
else if (line.matches(".*[\\w].*" + COMMENT + ".*")) {
115
// We need to strip out any comments, as they consume the newline
116
// character leading to incorrect script parsing.
117
- command.append(line.substring(0, line.indexOf(COMMENT)));
+ line = line.substring(0, line.indexOf(COMMENT));
118
+
119
+ // Add escaped single quotes where needed
120
+ line = line.replaceAll("'", "\''");
121
122
+ command.append(line);
123
}
124
else command.append(line);
125
0 commit comments