# HG changeset patch # User ali # Date 1381005504 -3600 # Node ID 4e0032160bb03f1b52d548df6405eb9bbf79b5da # Parent 1f1d40127177e5de20be2dd53fc0a91328f7e1e6# Parent 408b56cff0bd607d29aa35c8fa2ca2627fa40e19 Merge bug #21: False positive: Opening slanted double-quote, followed by single slanted quote, should be accepted by BL diff -r 1f1d40127177 -r 4e0032160bb0 bookloupe/bookloupe.c --- a/bookloupe/bookloupe.c Thu Oct 03 23:02:48 2013 +0100 +++ b/bookloupe/bookloupe.c Sat Oct 05 21:38:24 2013 +0100 @@ -1880,7 +1880,7 @@ } s1=g_utf8_next_char(g_utf8_next_char(t)); while (*s1 && !g_unichar_isalpha(g_utf8_get_char(s1)) && - !isdigit(g_utf8_get_char(s1))) + !g_unichar_isdigit(g_utf8_get_char(s1))) s1=g_utf8_next_char(s1); if (g_unichar_islower(g_utf8_get_char(s1))) { @@ -2438,7 +2438,7 @@ if (!parity) { /* parity even */ - if (!g_utf8_strchr("_-.'`/,;:!?)]} ",-1,nc)) + if (!g_utf8_strchr("_-.'`‘’/,;:!?)]} ",-1,nc)) { if (pswit[ECHO_SWITCH]) g_print("\n%s\n",aline); @@ -2453,8 +2453,8 @@ else { /* parity odd */ - if (!g_unichar_isalpha(nc) && !isdigit(nc) && - !g_utf8_strchr("_-/.'`([{$",-1,nc) || !nc) + if (!g_unichar_isalpha(nc) && !g_unichar_isdigit(nc) && + !g_utf8_strchr("_-/.'`‘’([{$",-1,nc) || !nc) { if (pswit[ECHO_SWITCH]) g_print("\n%s\n",aline); @@ -2513,7 +2513,7 @@ else { /* parity odd */ - if (!g_unichar_isalpha(nc) && !isdigit(nc) && + if (!g_unichar_isalpha(nc) && !g_unichar_isdigit(nc) && !g_utf8_strchr("_-/\".'`",-1,nc) || !nc) { if (pswit[ECHO_SWITCH]) @@ -3178,9 +3178,27 @@ for (;;) { c=g_utf8_get_char(*etext); + if (!c) + { + if (*etext==theline) + return NULL; + else if (pswit[LINE_END_SWITCH]) + { + if (pswit[ECHO_SWITCH]) + { + s=g_strndup(theline,eos-theline); + g_print("\n%s\n",s); + g_free(s); + } + if (!pswit[OVERVIEW_SWITCH]) + /* There may, or may not, have been a CR */ + g_print(" Line %ld - No LF?\n",lcnt); + else + cnt_lineend++; + } + break; + } *etext=g_utf8_next_char(*etext); - if (!c) - return NULL; /* either way, it's end of line */ if (c=='\n') { diff -r 1f1d40127177 -r 4e0032160bb0 test/bookloupe/curved-quotes.tst --- a/test/bookloupe/curved-quotes.tst Thu Oct 03 23:02:48 2013 +0100 +++ b/test/bookloupe/curved-quotes.tst Sat Oct 05 21:38:24 2013 +0100 @@ -19,6 +19,16 @@ you’d like to come.” “Sure! they chorused. + +* * * + +“‘Think I want to lug a bear two mile into camp?’ says he. ‘No, sir, I +lured this here bear in so’s I could kill him handy to where I wanted +him. I jest figgered to make him carry himself into camp,’ says he.” + +The widow shook her head. “’Tain’t nothin’ but a memento no more. Husbands +is all right, but enough’s enough. Let me make you acquainted with Miss +Ducharme, Mr. Ashe.” **************** WARNINGS ****************