Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 221753 - ArgumentParser may fail to parse command line with quotes
Summary: ArgumentParser may fail to parse command line with quotes
Status: CLOSED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Remote Tools (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Daniel Felix Ferber CLA
QA Contact: Greg Watson CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-06 16:38 EST by Daniel Felix Ferber CLA
Modified: 2011-01-31 07:51 EST (History)
1 user (show)

See Also:


Attachments
A patch that fixes the bug (13.51 KB, patch)
2008-03-06 16:51 EST, Daniel Felix Ferber CLA
g.watson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Felix Ferber CLA 2008-03-06 16:38:16 EST
ArgumentParser may fail when string contains quotes

For example, following list of arguments given as a string fails:
-I/opt/cell/sysroot/opt/cell/sdk/usr/spu/include -I"/home/dfferber/EclipseWorkspaces/runtime-cellide/multi_dma_ppu"
-O0 -g3 -Wall -c -fmessage-length=0 -Winline -Wextra -fno-inline -mtune=cell -mfloat=fast -mdouble=fast -Wno-main -march=cell
-mea32 -o/home/dfferber/EclipseWorkspaces/runtime-cellide/multi_dma_spu/sputiming/dma_spu.spuS -S

It produces only two tokens:

-I/opt/cell/sysroot/opt/cell/sdk/usr/spu/include 
and a second token containing all remaining characters.

The correct result should be a token for each argument.
Comment 1 Daniel Felix Ferber CLA 2008-03-06 16:47:30 EST
Found a switch case fall-thru that causes the bug.
Added more test cases and added more comments to code.
Comment 2 Daniel Felix Ferber CLA 2008-03-06 16:51:09 EST
Created attachment 91805 [details]
A patch that fixes the bug

This patch fixes the switch case fallthrough that caused the bug.
Comment 3 Greg Watson CLA 2008-03-07 07:42:49 EST
Applied. Please check and reopen if there are any problems.
Comment 4 Daniel Felix Ferber CLA 2008-05-05 15:49:42 EDT
Is working now.