Closed
Bug 506394
Opened 17 years ago
Closed 17 years ago
ExpandEnvironmentStringsW in CE shunt isn't quite right
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: zpao, Assigned: zpao)
References
Details
(Whiteboard: [nv])
Attachments
(1 file, 1 obsolete file)
|
2.80 KB,
patch
|
Details | Diff | Splinter Review |
As discussed with Vlad an on bug 504385 comment 3, the function we have in the shunt misses % parameters.
In Windows, "ceplayer.exe %1" will be returned as is. "ceplayer.exe %1 %2" will also be returned as is. Our implementation treats the first case as an invalid parameter. I'm not sure about the 2nd case, but it might mess up.
So the logic in our shunt implementation should be fixed to handle these cases better.
| Assignee | ||
Comment 1•17 years ago
|
||
This handles the space case & the end of string case. I did a little bit of code cleanup (for consistency's sake) & some whitespace cleanup while I was in there.
I tested against the Windows API (in XP) with the following strings and we now match correctly: "%APPDATA%\ceplayer.exe %1 %", "%APPDATA%\ceplayer.exe %1 %2", "%APPDATA%\ceplayer.exe %1", "ceplayer.exe %1"
Assignee: nobody → paul
Attachment #391407 -
Flags: review?(vladimir)
| Assignee | ||
Comment 2•17 years ago
|
||
While the patch addresses the problem, I found that we're still not quite perfect.
Take a basic string "ceplayer.exe" and we're one character short (presumably not accounting for null termination when calculating size on the first pass). Not sure if that's something we want to address now or just spin off or even really care about.
Comment on attachment 391407 [details] [diff] [review]
Patch v0.1
Looks fine to me, though boy is that code super scary.
Attachment #391407 -
Flags: review?(vladimir) → review+
| Assignee | ||
Comment 4•17 years ago
|
||
Taking out a stray variable declaration I accidentally added & minor change to whitespace.
Attachment #391407 -
Attachment is obsolete: true
| Assignee | ||
Comment 5•17 years ago
|
||
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Whiteboard: [nv]
You need to log in
before you can comment on or make changes to this bug.
Description
•