GP-866: resetSyntax required to prevent parsing of numbers as numbers in command line

This commit is contained in:
d-millar 2021-04-20 17:54:39 +00:00
parent 9113e08b48
commit 4d65ccd052
2 changed files with 33 additions and 0 deletions

View File

@ -98,6 +98,7 @@ public interface TargetLauncher extends TargetObject {
public CmdLineParser(Reader r) {
super(r);
resetSyntax();
wordChars(0, 255);
whitespaceChars(' ', ' ');
quoteChar('"');

View File

@ -0,0 +1,32 @@
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ghidra.dbg.target;
import static org.junit.Assert.*;
import java.util.List;
import org.junit.Test;
import ghidra.dbg.target.TargetLauncher.CmdLineParser;
public class TargetLauncherTest {
@Test
public void testCmdLineParser() {
assertEquals(List.of("C:\\Windows", "10\\notepad.exe"),
CmdLineParser.tokenize("C:\\Windows 10\\notepad.exe"));
}
}