-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fix a bug caused by #16592 #16624
Merged
Merged
Fix a bug caused by #16592 #16624
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
microsoft-github-policy-service
bot
added
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Priority-0
Bugs that we consider release-blocking/recall-class (P0)
Product-Terminal
The new Windows Terminal.
Severity-Blocking
We won't ship a release like this! No-siree.
labels
Jan 30, 2024
zadjii-msft
approved these changes
Jan 30, 2024
DHowett
approved these changes
Jan 30, 2024
DHowett
pushed a commit
that referenced
this pull request
Jan 31, 2024
#16592 passes the return value of `GetEnvironmentStringsW` directly to the `hstring` constructor even though the former returns a double-null terminated string and the latter expects a regular one. This PR fixes the issue by using a basic strlen() loop to compute the length ourselves. It's still theoretically beneficial over the previous code, but now it's rather bitter since the code isn't particularly short anymore and so the biggest benefit is gone. Closes #16623 ## Validation Steps Performed * Validated the `env` string in a debugger ✅ It's 1 character shorter than the old `til::env` string. That's fine however, since any `HSTRING` is always null-terminated anyways and so we get an extra null-terminator for free. * `wt powershell` works ✅ (cherry picked from commit c669afe) Service-Card-Id: 91719861 Service-Version: 1.18
DHowett
pushed a commit
that referenced
this pull request
Jan 31, 2024
#16592 passes the return value of `GetEnvironmentStringsW` directly to the `hstring` constructor even though the former returns a double-null terminated string and the latter expects a regular one. This PR fixes the issue by using a basic strlen() loop to compute the length ourselves. It's still theoretically beneficial over the previous code, but now it's rather bitter since the code isn't particularly short anymore and so the biggest benefit is gone. Closes #16623 ## Validation Steps Performed * Validated the `env` string in a debugger ✅ It's 1 character shorter than the old `til::env` string. That's fine however, since any `HSTRING` is always null-terminated anyways and so we get an extra null-terminator for free. * `wt powershell` works ✅ (cherry picked from commit c669afe) Service-Card-Id: 91719863 Service-Version: 1.20
DHowett
pushed a commit
that referenced
this pull request
Jan 31, 2024
#16592 passes the return value of `GetEnvironmentStringsW` directly to the `hstring` constructor even though the former returns a double-null terminated string and the latter expects a regular one. This PR fixes the issue by using a basic strlen() loop to compute the length ourselves. It's still theoretically beneficial over the previous code, but now it's rather bitter since the code isn't particularly short anymore and so the biggest benefit is gone. Closes #16623 ## Validation Steps Performed * Validated the `env` string in a debugger ✅ It's 1 character shorter than the old `til::env` string. That's fine however, since any `HSTRING` is always null-terminated anyways and so we get an extra null-terminator for free. * `wt powershell` works ✅ (cherry picked from commit c669afe) Service-Card-Id: 91719862 Service-Version: 1.19
@mjpraxis this was already rolled out in v1.19.10302.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Priority-0
Bugs that we consider release-blocking/recall-class (P0)
Product-Terminal
The new Windows Terminal.
Severity-Blocking
We won't ship a release like this! No-siree.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#16592 passes the return value of
GetEnvironmentStringsW
directlyto the
hstring
constructor even though the former returns adouble-null terminated string and the latter expects a regular one.
This PR fixes the issue by using a basic strlen() loop to compute
the length ourselves. It's still theoretically beneficial over
the previous code, but now it's rather bitter since the code isn't
particularly short anymore and so the biggest benefit is gone.
Closes #16623
Validation Steps Performed
env
string in a debugger ✅It's 1 character shorter than the old
til::env
string.That's fine however, since any
HSTRING
is always null-terminatedanyways and so we get an extra null-terminator for free.
wt powershell
works ✅