mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Remove extra quotes from meta-data
Arguments are passed as argp[] array to execve() and don't need to be enclosed by quotes.
This commit is contained in:
parent
952577b480
commit
86138d18f9
1 changed files with 10 additions and 11 deletions
|
|
@ -249,23 +249,22 @@ SystemExec::format_key_value_parameter (std::string key, std::string value)
|
||||||
start_pos += 1;
|
start_pos += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PLATFORM_WINDOWS
|
||||||
|
/* SystemExec::make_wargs() adds quotes around the complete argument
|
||||||
|
* windows uses CreateProcess() with a parameter string
|
||||||
|
* (and not an array list of separate arguments like Unix)
|
||||||
|
* so quotes need to be escaped.
|
||||||
|
*/
|
||||||
start_pos = 0;
|
start_pos = 0;
|
||||||
while((start_pos = v1.find("\"", start_pos)) != std::string::npos) {
|
while((start_pos = v1.find("\"", start_pos)) != std::string::npos) {
|
||||||
v1.replace(start_pos, 1, "\\\"");
|
v1.replace(start_pos, 1, "\\\"");
|
||||||
start_pos += 2;
|
start_pos += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t len = key.length() + v1.length() + 4;
|
|
||||||
char *mds = (char*) calloc(len, sizeof(char));
|
|
||||||
#ifdef PLATFORM_WINDOWS
|
|
||||||
/* SystemExec::make_wargs() adds quotes around the complete argument
|
|
||||||
* windows uses CreateProcess() with a parameter string
|
|
||||||
* (and not an array list of separate arguments)
|
|
||||||
*/
|
|
||||||
snprintf(mds, len, "%s=%s", key.c_str(), v1.c_str());
|
|
||||||
#else
|
|
||||||
snprintf(mds, len, "%s=\"%s\"", key.c_str(), v1.c_str());
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
size_t len = key.length() + v1.length() + 2;
|
||||||
|
char *mds = (char*) calloc(len, sizeof(char));
|
||||||
|
snprintf(mds, len, "%s=%s", key.c_str(), v1.c_str());
|
||||||
return mds;
|
return mds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue