mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-866: resetSyntax required to prevent parsing of numbers as numbers in command line
This commit is contained in:
parent
9113e08b48
commit
4d65ccd052
2 changed files with 33 additions and 0 deletions
|
@ -98,6 +98,7 @@ public interface TargetLauncher extends TargetObject {
|
||||||
|
|
||||||
public CmdLineParser(Reader r) {
|
public CmdLineParser(Reader r) {
|
||||||
super(r);
|
super(r);
|
||||||
|
resetSyntax();
|
||||||
wordChars(0, 255);
|
wordChars(0, 255);
|
||||||
whitespaceChars(' ', ' ');
|
whitespaceChars(' ', ' ');
|
||||||
quoteChar('"');
|
quoteChar('"');
|
||||||
|
|
|
@ -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"));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue