Skip to content

Commit

Permalink
We do not want to rely on the infos provided by the user defined call…
Browse files Browse the repository at this point in the history
…back functions, so we check the length of the user-strings internally
  • Loading branch information
Alex Schneider committed Mar 1, 2017
1 parent e3387df commit f1392da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions extcss3/tokenizer/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,11 @@ static inline bool _extcss3_token_add(extcss3_intern *intern, extcss3_token *tok
if (intern->base_ctxt != NULL) {
if (EXTCSS3_TYPE_IS_MODIFIABLE(token->type) && (intern->modifier.callback != NULL)) {
intern->modifier.callback(intern);

if ((token->user.str != NULL) && (token->user.len > token->data.len)) {
intern->modifier.user_strlen_diff -= token->data.len;
intern->modifier.user_strlen_diff += token->user.len;
}
}

if (EXTCSS3_SUCCESS != extcss3_ctxt_update(intern, error)) {
Expand Down
3 changes: 0 additions & 3 deletions php_extcss3.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ static void php_extcss3_modifier_callback(extcss3_intern *intern)
intern->last_token->user.str = (char *)calloc(intern->last_token->user.len, sizeof(char));

memcpy(intern->last_token->user.str, Z_STRVAL(retval), Z_STRLEN(retval));

intern->modifier.user_strlen_diff -= intern->last_token->data.len;
intern->modifier.user_strlen_diff += intern->last_token->user.len;
}
}

Expand Down

0 comments on commit f1392da

Please sign in to comment.