mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 09:45:39 +02:00
trim strings
This commit is contained in:
parent
a8edb98ca7
commit
02988e794e
1 changed files with 4 additions and 4 deletions
|
@ -22,7 +22,7 @@ public class MacroDefinition extends Statement implements IMacroDefinition {
|
|||
value = new StringBuffer();
|
||||
int index = line.indexOf('=');
|
||||
if (index != -1) {
|
||||
name = line.substring(0, index);
|
||||
name = line.substring(0, index).trim();
|
||||
value.append(line.substring(index + 1));
|
||||
} else {
|
||||
name = line;
|
||||
|
@ -39,11 +39,11 @@ public class MacroDefinition extends Statement implements IMacroDefinition {
|
|||
}
|
||||
|
||||
public void setName(String n) {
|
||||
name = n;
|
||||
name = (n == null) ? "" : n.trim() ;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value.toString();
|
||||
return value.toString().trim();
|
||||
}
|
||||
|
||||
public void setValue(String val) {
|
||||
|
@ -59,7 +59,7 @@ public class MacroDefinition extends Statement implements IMacroDefinition {
|
|||
*/
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append(name).append(" = ").append(value).append('\n');
|
||||
buffer.append(getName()).append(" = ").append(getValue()).append('\n');
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue