Fix extra quote escape in golang
This commit is contained in:
parent
256e283fc3
commit
b4b4c0a25e
1 changed files with 26 additions and 20 deletions
|
|
@ -2800,29 +2800,35 @@ private:
|
||||||
String *get = NewString("");
|
String *get = NewString("");
|
||||||
Printv(get, Swig_cresult_name(), " = ", NULL);
|
Printv(get, Swig_cresult_name(), " = ", NULL);
|
||||||
|
|
||||||
char quote;
|
String *rawval = Getattr(n, "rawval");
|
||||||
if (Getattr(n, "wrappedasconstant")) {
|
if (rawval && Len(rawval)) {
|
||||||
quote = '\0';
|
Printv(get, rawval, NULL);
|
||||||
} else if (SwigType_type(type) == T_CHAR) {
|
|
||||||
quote = '\'';
|
|
||||||
} else if (SwigType_type(type) == T_STRING) {
|
|
||||||
Printv(get, "(char *)", NULL);
|
|
||||||
quote = '"';
|
|
||||||
} else {
|
} else {
|
||||||
quote = '\0';
|
char quote;
|
||||||
|
if (Getattr(n, "wrappedasconstant")) {
|
||||||
|
quote = '\0';
|
||||||
|
} else if (SwigType_type(type) == T_CHAR) {
|
||||||
|
quote = '\'';
|
||||||
|
} else if (SwigType_type(type) == T_STRING) {
|
||||||
|
Printv(get, "(char *)", NULL);
|
||||||
|
quote = '"';
|
||||||
|
} else {
|
||||||
|
quote = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (quote != '\0') {
|
||||||
|
Printf(get, "%c", quote);
|
||||||
|
}
|
||||||
|
|
||||||
|
Printv(get, Getattr(n, "value"), NULL);
|
||||||
|
|
||||||
|
if (quote != '\0') {
|
||||||
|
Printf(get, "%c", quote);
|
||||||
|
}
|
||||||
|
|
||||||
|
Printv(get, ";\n", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quote != '\0') {
|
|
||||||
Printf(get, "%c", quote);
|
|
||||||
}
|
|
||||||
|
|
||||||
Printv(get, Getattr(n, "value"), NULL);
|
|
||||||
|
|
||||||
if (quote != '\0') {
|
|
||||||
Printf(get, "%c", quote);
|
|
||||||
}
|
|
||||||
|
|
||||||
Printv(get, ";\n", NULL);
|
|
||||||
Setattr(n, "wrap:action", get);
|
Setattr(n, "wrap:action", get);
|
||||||
|
|
||||||
String *sname = Copy(symname);
|
String *sname = Copy(symname);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue