Skip to content

fix: linux, get_env, break loop #12174

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

Merged
merged 1 commit into from
Jun 26, 2025
Merged

Conversation

fufesou
Copy link
Collaborator

@fufesou fufesou commented Jun 26, 2025

No description provided.

@fufesou fufesou requested a review from Copilot June 26, 2025 05:50
Copilot

This comment was marked as outdated.

@fufesou fufesou force-pushed the fix/linux_get_env branch from 0663a4d to 6240284 Compare June 26, 2025 06:22
@fufesou fufesou requested a review from Copilot June 26, 2025 06:22
Copilot

This comment was marked as outdated.

@rustdesk rustdesk requested a review from Copilot June 26, 2025 06:43
Copilot

This comment was marked as outdated.

@fufesou fufesou force-pushed the fix/linux_get_env branch from 6240284 to 0bc02c2 Compare June 26, 2025 06:45
@fufesou fufesou closed this Jun 26, 2025
@fufesou fufesou reopened this Jun 26, 2025
@rustdesk rustdesk requested a review from Copilot June 26, 2025 07:39
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issues related to environment variable retrieval on Linux by adjusting loop iteration ranges and changing loop termination from break to an immediate return when the required conditions are met.

  • Increased loop iterations from 5 or 10 (starting at 0) to 10 (starting at 1).
  • Replaced break statements with return in two functions to exit immediately when environment variables are found.
  • Added an early exit condition in one loop to break if the display string is already populated.
Comments suppressed due to low confidence (5)

src/platform/linux.rs:1050

  • Changed loop iteration range from 0..5 to 1..=10. Ensure that increasing the number of iterations aligns with the desired behavior for environment variable lookup.
            for _ in 1..=10 {

src/platform/linux.rs:1063

  • Replacing 'break' with 'return' in get_display_xauth_xwayland changes the function's control flow by exiting immediately. Confirm that this early exit is intentional and does not bypass any necessary cleanup or subsequent logic.
                        return;

src/platform/linux.rs:1071

  • The loop range update in get_display_x11 to use 1..=10 increases the number of attempts. Verify that this adjustment meets the intended logic for the environment retrieval process.
            for _ in 1..=10 {

src/platform/linux.rs:1086

  • Adding an early exit check for self.display may alter the expected loop behavior. Please review whether breaking the loop at this condition is appropriate with respect to the overall logic.
                if !self.display.is_empty() {

src/platform/linux.rs:1171

  • In get_xauth_x11, using 'return' instead of 'break' results in an immediate exit from the function. Ensure that this change in control flow is consistent with the intended design for processing and cleanup.
                        return;

Signed-off-by: fufesou <linlong1266@gmail.com>
@fufesou fufesou force-pushed the fix/linux_get_env branch from 0bc02c2 to 7a46dae Compare June 26, 2025 07:42
@rustdesk rustdesk merged commit 58fd2d3 into rustdesk:master Jun 26, 2025
8 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy