* Added quotes parsing to @set (bugreport:7171)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17099 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
e73613642c
commit
56adc76382
@ -8585,7 +8585,7 @@ ACMD_FUNC(accinfo) {
|
||||
ACMD_FUNC(set) {
|
||||
char reg[32], val[128];
|
||||
struct script_data* data;
|
||||
int toset = 0;
|
||||
int toset = 0, len;
|
||||
bool is_str = false;
|
||||
|
||||
if( !message || !*message || (toset = sscanf(message, "%32s %128[^\n]s", reg, val)) < 1 ) {
|
||||
@ -8607,6 +8607,13 @@ ACMD_FUNC(set) {
|
||||
|
||||
is_str = ( reg[strlen(reg) - 1] == '$' ) ? true : false;
|
||||
|
||||
if( ( len = strlen(val) ) > 1 ) {
|
||||
if( val[0] == '"' && val[len-1] == '"') {
|
||||
val[len-1] = '\0'; //Strip quotes.
|
||||
memmove(val, val+1, len-1);
|
||||
}
|
||||
}
|
||||
|
||||
if( toset >= 2 ) {/* we only set the var if there is an val, otherwise we only output the value */
|
||||
if( is_str )
|
||||
set_var(sd, reg, (void*) val);
|
||||
|
Loading…
x
Reference in New Issue
Block a user