diff --git a/golded3/getpls.cpp b/golded3/getpls.cpp index 63a43a6..3cb9b13 100644 --- a/golded3/getpls.cpp +++ b/golded3/getpls.cpp @@ -755,7 +755,9 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa std::replace(tempref.begin(), tempref.end(), CTRL_A, '@'); quote = tempref.c_str(); - if(is_quote(oldmsg->line[n]->txt.c_str())) { +// if(is_quote(oldmsg->line[n]->txt.c_str())) { + if (oldmsg->line[n]->type & GLINE_QUOT) + { quote += GetQuotestr(quote, qbuf, &len); strbtrim(qbuf); ptr = qbuf; diff --git a/golded3/geutil.cpp b/golded3/geutil.cpp index 10d162e..6344d86 100644 --- a/golded3/geutil.cpp +++ b/golded3/geutil.cpp @@ -339,11 +339,20 @@ int is_quote(const char* ptr) { return false; // Check for userdefined quotechars after first whitespace - if(IsQuoteChar(ptr)) + if(IsQuoteChar(ptr)) return true; endptr = ptr + 11; // match 10 chars after whitespaces + while (*ptr && !IsQuoteChar(ptr) && + !iscntrl(*ptr) && + !strchr(AA->Quotestops(), *ptr) && + !isspace(*ptr)) ptr++; + + if ((ptr < endptr) && IsQuoteChar(ptr)) + return true; + +/* int spaces = 0; while((ptr < endptr) and *ptr) { @@ -366,6 +375,7 @@ int is_quote(const char* ptr) { } ptr++; } +*/ return false; } @@ -483,7 +493,7 @@ int GetQuotestr(const char* ptr, char* qbuf, uint* qlen) { const char* lp = ptr; int n, x; - +/* for(;;) { // Skip leading spaces @@ -512,6 +522,11 @@ int GetQuotestr(const char* ptr, char* qbuf, uint* qlen) { break; } +*/ + + while (isspace(*lp) or issoftcr(*lp)) lp++; + while (!IsQuoteChar(lp)) lp++; + while (IsQuoteChar(lp)) lp++; // lp now points to the character after the quotestring