head 1.2; access; symbols; locks; strict; comment @// @; 1.2 date 2020.08.13.16.22.40; author scole; state dead; branches; next 1.1; commitid cDXSzCaYwVyncVjC; 1.1 date 2020.07.30.02.13.56; author scole; state Exp; branches; next ; commitid CEGefSpz9ZX6X2iC; desc @@ 1.2 log @- Use github home URL now - Github changes from author to fix NetBSD's missing wcpcpy & wcpncpy @ text @$NetBSD: patch-src_filterrtf.cpp,v 1.1 2020/07/30 02:13:56 scole Exp $ Use wchar functions available on NetBSD --- src/filterrtf.cpp.orig 2018-08-14 05:33:16.000000000 +0000 +++ src/filterrtf.cpp @@@@ -3,6 +3,7 @@@@ ////////////////////////////////////////////////////////////////////// #include #include +#include #include #include "filterrtf.h" #include "conv/utf8.h" @@@@ -109,7 +110,7 @@@@ FilterRTF::GetNextToken (wchar_t* token, { *thaiFlag = isThaiUni (strbuff[0]); nCopy = min (tokenSz - 1, wcslen (strbuff)); - token = wcpncpy (token, strbuff, nCopy); + token = wcsncpy (token, strbuff, nCopy); *token = 0; tokenSz -= nCopy; wmemmove (strbuff, strbuff + nCopy, wcslen (strbuff + nCopy) + 1); @@@@ -155,7 +156,7 @@@@ FilterRTF::GetNextToken (wchar_t* token, int len = strlen (rtfToken.getVal()); if (len + 2 <= tokenSz - 1) { - token = wcpcpy (token, L"\\u"); + token = wcscpy (token, L"\\u"); token = Ascii2WcsCopy (token, rtfToken.getVal()); tokenSz -= len + 2; } @@@@ -177,7 +178,7 @@@@ FilterRTF::GetNextToken (wchar_t* token, int len = strlen (rtfToken.getVal()); if (len + 2 <= tokenSz - 1) { - token = wcpcpy (token, L"\\'"); + token = wcscpy (token, L"\\'"); token = Ascii2WcsCopy (token, rtfToken.getVal()); tokenSz -= len + 2; } @@@@ -251,7 +252,7 @@@@ thai_flag_determined: else { // non-Thai text is found -> prepare to stop - wchar_t* p = wcpcpy (strbuff, L"\\u"); + wchar_t* p = wcscpy (strbuff, L"\\u"); Ascii2WcsCopy (p, rtfToken.getVal()); isCopySkipBytes = true; } @@@@ -339,7 +340,7 @@@@ thai_flag_determined: int len = strlen (rtfToken.getVal()); if (len + 2 <= tokenSz - 1) { - token = wcpcpy (token, L"\\u"); + token = wcscpy (token, L"\\u"); token = Ascii2WcsCopy (token, rtfToken.getVal()); tokenSz -= len + 2; } @@@@ -359,7 +360,7 @@@@ thai_flag_determined: int len = strlen (rtfToken.getVal()); if (len + 2 <= tokenSz - 1) { - token = wcpcpy (token, L"\\'"); + token = wcscpy (token, L"\\'"); token = Ascii2WcsCopy (token, rtfToken.getVal()); tokenSz -= len + 2; } @ 1.1 log @doc: Updated textproc/swath to 0.6.1 0.6.1 (2018-08-20) ===== - Updated word break dictionary. - Fix a defect in RTF parsing, so RTF gets more complete word break positions. - Compiler warning fixes. - Minor code cleanups. - Useful installation instructions in INSTALL file. (Thanks @@pepa65 for the pull request.) 0.6.0 (2017-11-28) ===== - Updated word break dictionary. - Drop undocumented option '-l'. - Revamped internal word break engine. - Updated manpage. 0.5.5 (2016-12-25) ===== - Updated word break dictionary. 0.5.4 (2016-07-08) ===== - Updated word break dictionary. - Fix segfault on extremely long input lines. - Support longer input lines. (Bug report by Santi Romeyen) - Support non-ASCII word break string. https://github.com/tlwg/swath/issues/1 - Some source code clean-ups. - Add test suite. 0.5.3 (2014-09-01) ===== - Updated word break dictionary. - Fix premature output ending on long UTF-8 input line. (Bug report by Sorawee Porncharoenwase) - Fix excessive break positions in plain text mode. (Bug report by Sorawee Porncharoenwase) - Remove dead codes, resulting in a little smaller binary. 0.5.2 (2013-12-23) ===== - Fix infinite loops in LaTeX filter. (Bug report and patch by Neutron Soutmun) - Fix off-by-one character loss in long HTML tokens. (Bug report and analysis by Nicolas Brouard) 0.5.1 (2013-10-30) ===== - Correct word break code for Lambda. - Updated word break dictionary. - Adjust file filters to prevent potential buffer overflow. 0.5.0 (2013-02-11) ===== - Character encoding conversion is now spontaneous, no more buffering via temporary file. - Rewritten RTF filter. It's now tested to work with real RTF document. - Process characters as Unicode internally, so that characters not present in TIS-620 are not lost in output. - Fix potential buffer overflow vulnerability in Mule mode. - Updated word break dictionary. - Significant source clean-ups. - Switch to XZ tarball compression. For pkgsrc, use gmake and add patch to compile wchar functions on NetBSD @ text @d1 1 a1 1 $NetBSD: patch-src_filterrtf.cpp,v 1.1 2020/07/28 20:11:22 scole Exp $ @