Bug 102174 - Environment variables with multi-line settings not parsed correctly
Summary: Environment variables with multi-line settings not parsed correctly
Status: VERIFIED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 2.1.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: Alain Magloire CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-06-29 13:33 EDT by Joanne Woo CLA
Modified: 2008-06-19 13:02 EDT (History)
1 user (show)

See Also:


Attachments
Restore environment variables which contain embedded new line(s). (1.74 KB, patch)
2005-06-29 13:35 EDT, Joanne Woo CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joanne Woo CLA 2005-06-29 13:33:45 EDT
In
org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader::getEnvVars(),

environment variables which contains '\n' are parsed as separate lines.

Example:
  P, S, 1, =, \, [, \, 0, 3, 3, ], 0, ;, \, w, \, 0, 0, 7, \n,
  \, 0, 3, 3, [, 3, 2, m, \, ], \, u, @, \, h,	, \, [, \, 0, 3, 3, [, 3, 3,
  m, \, w, \, 0, 3, 3, [, 0, m, \, ], \n,
  $,  ,

results in two phony environment variables named "\033[32..." and "$
" being defined.

A proposed patch is attached.
Comment 1 Joanne Woo CLA 2005-06-29 13:35:22 EDT
Created attachment 24139 [details]
Restore environment variables which contain embedded new line(s).
Comment 2 Alain Magloire CLA 2005-06-29 22:56:01 EDT
You are right.
I modify the patch to check for prev_key == null && prev_value == null.
Just to be on the safe side.  CDT supports so many weird platforms.
Comment 3 Joanne Woo CLA 2005-06-29 22:58:19 EDT
Thanks, Alain!
Comment 4 Alain Magloire CLA 2005-06-29 23:00:15 EDT
Thanks, the patch is in the head.
Please let me know if it agrees with you, by fliping the state of the
PR to verify

The PR is mark 30RC2 not sure if it will make the cut
for 30RC1
Comment 5 Joanne Woo CLA 2005-06-30 12:51:18 EDT
Looks good, Alain.  Thanks!