Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

escape: replace Curl_isunreserved with ISUNRESERVED #11846

Closed
wants to merge 1 commit into from

Conversation

jay
Copy link
Member

@jay jay commented Sep 13, 2023

  • Use the ALLCAPS version of the macro so that it is clear a macro is being called that evaluates the variable multiple times.

  • Also capitalize macro isurlpuntcs => ISURLPUNTCS since it evaluates a variable multiple times.

This is a follow-up to 291d225 which changed Curl_isunreserved into an alias macro for ISUNRESERVED. The problem is the former is not easily identified as a macro by the caller, which could lead to a bug.

For example, ISUNRESERVED(*foo++) is easily identifiable as wrong but Curl_isunreserved(*foo++) is not even though they both are the same.

Closes #xxxx

- Use the ALLCAPS version of the macro so that it is clear a macro is
  being called that evaluates the variable multiple times.

- Also capitalize macro isurlpuntcs => ISURLPUNTCS since it evaluates
  a variable multiple times.

This is a follow-up to 291d225 which changed Curl_isunreserved into an
alias macro for ISUNRESERVED. The problem is the former is not easily
identified as a macro by the caller, which could lead to a bug.

For example, ISUNRESERVED(*foo++) is easily identifiable as wrong but
Curl_isunreserved(*foo++) is not even though they both are the same.

Closes #xxxx
@jay jay added the tidy-up label Sep 13, 2023
@jay jay requested a review from bagder September 13, 2023 18:44
@jay jay closed this in 7a2421d Sep 14, 2023
@jay jay deleted the ctype_macro_capitalize branch September 14, 2023 07:17
ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
- Use the ALLCAPS version of the macro so that it is clear a macro is
  being called that evaluates the variable multiple times.

- Also capitalize macro isurlpuntcs => ISURLPUNTCS since it evaluates
  a variable multiple times.

This is a follow-up to 291d225 which changed Curl_isunreserved into an
alias macro for ISUNRESERVED. The problem is the former is not easily
identified as a macro by the caller, which could lead to a bug.

For example, ISUNRESERVED(*foo++) is easily identifiable as wrong but
Curl_isunreserved(*foo++) is not even though they both are the same.

Closes curl#11846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants