diff options
-rw-r--r-- | pico/word.c | 13 | ||||
-rw-r--r-- | pith/pine.hlp | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/pico/word.c b/pico/word.c index a46bf3ef..e5b361b7 100644 --- a/pico/word.c +++ b/pico/word.c @@ -510,7 +510,7 @@ quote_match(UCS *q, LINE *gl, UCS *bufl, size_t buflen) LINE *nl = gl != curbp->b_linep ? lforw(gl) : NULL; LINE *pl = lback(gl) != curbp->b_linep ? lback(gl) : NULL; UCS bufp[NSTRING], bufn[NSTRING]; - int i, j; + int i, j, qstart, qend; int quoted_line = 0; do_quote_match(q, pl, bufp, sizeof(bufp)); /* previous line */ @@ -522,8 +522,15 @@ quote_match(UCS *q, LINE *gl, UCS *bufl, size_t buflen) /* is this line quoted? */ if(q && *q){ - for(i = 0; i < llength(gl) && q[i] && lgetc(gl, i).c == q[i]; i++); - if(!q[i]) + /* pare down q so it contains no leading or trailing whitespace */ + for(i = 0; q[i] == ' '; i++); + qstart = i; + for(i = ucs4_strlen(q); i > 0 && q[i-1] == ' '; i--); + qend = i; + for(i = 0; i < llength(gl) + && i + qstart < qend + && lgetc(gl, i).c == q[i+qstart]; i++); + if(i + qstart == qend) quoted_line = 1; } diff --git a/pith/pine.hlp b/pith/pine.hlp index edd2896d..cf5039b1 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 15 2013-07-10 23:11:10 +Alpine Commit 17 2013-07-15 14:35:02 ============= h_news ================= <HTML> <HEAD> |