Skip to content

Commit

Permalink
v1.1.6 to CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed Nov 10, 2017
1 parent b14c034 commit 64651ed
Show file tree
Hide file tree
Showing 9 changed files with 192 additions and 43 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: stringi
Version: 1.1.6
Date: 2017-11-06
Date: 2017-11-10
Title: Character String Processing Facilities
Description: Allows for fast, correct, consistent, portable,
as well as convenient character string/text processing in every locale
Expand Down
12 changes: 3 additions & 9 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
stringi package NEWS and CHANGELOG
===============================================================================

## 1.1.6 (on the way)

* @TODO:........[GENERAL] #69: `stringi` is now bundled with ICU4C 59.1.
update to ICU 59 if c++11, stay ICU 55 on Solaris #193
## 1.1.6 (2017-11-10) **CRAN**

* [WINDOWS SPECIFIC] #270: Strings marked with `latin1` encoding
are now converted internally to UTF-8 using the WINDOWS-1252 codec.
Expand All @@ -13,14 +10,11 @@ This fixes problems with - among others - displaying the Euro sign.
* [NEW FEATURE] #263: Add support for custom rule-based break iteration,
see `?stri_opts_brkiter`.

* emojis......

* stri_width for emojis....

* [NEW FEATURE] #267: `omit_na=TRUE` in `stri_sub<-` now ignores missing values
in any of the arguments provided.

* t.b.d.
* [BUGFIX] fixed unPROTECTed variable names and stack imbalances
as reported by rchk

-------------------------------------------------------------------------------

Expand Down
3 changes: 2 additions & 1 deletion devel/testthat/test-prepare-arguments.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ suppressWarnings(test_that("stri_prepare_arg_string", {
expect_identical(stringi:::stri_prepare_arg_string(list(1, 2, 3)), as.character(list(1, 2, 3)))
expect_identical(stringi:::stri_prepare_arg_string(data.frame(1, 2, 3)), as.character(data.frame(1, 2, 3)))


}))

suppressWarnings(test_that("stri_prepare_arg_double", {
Expand Down Expand Up @@ -126,7 +127,7 @@ suppressWarnings(test_that("stri_prepare_arg_double_1", {
#suppressWarnings(stringi:::stri_prepare_arg_double_1(character(0)))
suppressWarnings(expect_equivalent(stringi:::stri_prepare_arg_double_1(1:5),1))
suppressWarnings(expect_equivalent(stringi:::stri_prepare_arg_double_1(1.5:5),1.5))
suppressWarnings(expect_equivalent(stringi:::stri_prepare_arg_double_1(as.factor(1:5)),1))
suppressWarnings(expect_equivalent(stringi:::stri_prepare_arg_double_1(as.factor(10+1:5)),10+1))


suppressWarnings(expect_error(stringi:::stri_prepare_arg_double_1(NULL)))
Expand Down
5 changes: 4 additions & 1 deletion src/stri_collator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
*
* @version 0.4-1 (Marek Gagolewski, 2014-12-08)
* #23: add `overlap` option
*
* @version 1.1.6 (Marek Gagolewski, 2017-11-10)
* PROTECT STRING_ELT(names, i)
*/
UCollator* stri__ucol_open(SEXP opts_collator)
{
Expand Down Expand Up @@ -96,7 +99,7 @@ UCollator* stri__ucol_open(SEXP opts_collator)
if (STRING_ELT(names, i) == NA_STRING)
Rf_error(MSG__INCORRECT_COLLATOR_OPTION_SPEC); // error() allowed here

const char* curname = CHAR(STRING_ELT(names, i));
const char* curname = stri__copy_string_Ralloc(STRING_ELT(names, i), "curname"); /* this is R_alloc'ed */
if (!strcmp(curname, "locale")) {
opt_LOCALE = stri__prepare_arg_locale(VECTOR_ELT(opts_collator, i), "locale", true); /* this is R_alloc'ed */
} else if (!strcmp(curname, "strength")) {
Expand Down
6 changes: 4 additions & 2 deletions src/stri_container_bytesearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ StriByteSearchMatcher* StriContainerByteSearch::getMatcher(R_len_t i) {
*
* @version 0.4-1 (Marek Gagolewski, 2014-12-08)
* add `overlap` option
*
* @version 1.1.6 (Marek Gagolewski, 2017-11-10)
* PROTECT STRING_ELT(names, i)
*/
uint32_t StriContainerByteSearch::getByteSearchFlags(SEXP opts_fixed, bool allow_overlap)
{
Expand All @@ -404,8 +407,7 @@ uint32_t StriContainerByteSearch::getByteSearchFlags(SEXP opts_fixed, bool allow
if (STRING_ELT(names, i) == NA_STRING)
Rf_error(MSG__FIXED_CONFIG_FAILED); // error() call allowed here

const char* curname = CHAR(STRING_ELT(names, i));

const char* curname = stri__copy_string_Ralloc(STRING_ELT(names, i), "curname"); /* this is R_alloc'ed */
if (!strcmp(curname, "case_insensitive")) {
bool val = stri__prepare_arg_logical_1_notNA(VECTOR_ELT(opts_fixed, i), "case_insensitive");
if (val) flags |= BYTESEARCH_CASE_INSENSITIVE;
Expand Down
6 changes: 4 additions & 2 deletions src/stri_container_regex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ RegexMatcher* StriContainerRegexPattern::getMatcher(R_len_t i)
*
* @version 0.3-1 (Marek Gagolewski, 2014-11-05)
* Disallow NA options
*
* @version 1.1.6 (Marek Gagolewski, 2017-11-10)
* PROTECT STRING_ELT(names, i)
*/
uint32_t StriContainerRegexPattern::getRegexFlags(SEXP opts_regex)
{
Expand All @@ -159,8 +162,7 @@ uint32_t StriContainerRegexPattern::getRegexFlags(SEXP opts_regex)
if (STRING_ELT(names, i) == NA_STRING)
Rf_error(MSG__REGEXP_CONFIG_FAILED); // error() call allowed here

const char* curname = CHAR(STRING_ELT(names, i));

const char* curname = stri__copy_string_Ralloc(STRING_ELT(names, i), "curname"); /* this is R_alloc'ed */
if (!strcmp(curname, "case_insensitive")) {
bool val = stri__prepare_arg_logical_1_notNA(VECTOR_ELT(opts_regex, i), "case_insensitive");
if (val) flags |= UREGEX_CASE_INSENSITIVE;
Expand Down
Loading

0 comments on commit 64651ed

Please sign in to comment.