Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/utils.c @ 1452:83e275dca409
Fix escaping bug in strip_arg_special_chars()
Hopefully fix the escape bug reported by bb...
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Wed, 02 Apr 2008 22:26:44 +0200 |
parents | 72dd9c768f58 |
children | 17e95be6c39b |
comparison
equal
deleted
inserted
replaced
1451:bf6539a31d65 | 1452:83e275dca409 |
---|---|
391 if (*p == '"') { | 391 if (*p == '"') { |
392 if (!escape) { | 392 if (!escape) { |
393 instring = !instring; | 393 instring = !instring; |
394 strcpy(p, p+1); | 394 strcpy(p, p+1); |
395 p--; | 395 p--; |
396 } else { | 396 } else |
397 escape = FALSE; | 397 escape = FALSE; |
398 } | |
399 } else if (*p == '\\') { | 398 } else if (*p == '\\') { |
400 if (!escape) { | 399 if (!escape) { |
401 if (*(p+1) == '"') { | 400 strcpy(p, p+1); |
402 strcpy(p, p+1); | 401 p--; |
403 p--; | |
404 } | |
405 escape = TRUE; | |
406 } else { | |
407 escape = FALSE; | |
408 } | 402 } |
409 } | 403 escape = !escape; |
404 } else | |
405 escape = FALSE; | |
410 } | 406 } |
411 } | 407 } |
412 | 408 |
413 // split_arg(arg, n, preservelast) | 409 // split_arg(arg, n, preservelast) |
414 // Split the string arg into a maximum of n pieces, taking care of | 410 // Split the string arg into a maximum of n pieces, taking care of |