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

Nothing of cheats available on Windows #576

Closed
neo-sam opened this issue Jul 6, 2021 · 10 comments · Fixed by #840
Closed

Nothing of cheats available on Windows #576

neo-sam opened this issue Jul 6, 2021 · 10 comments · Fixed by #840
Labels
bug Something isn't working

Comments

@neo-sam
Copy link

neo-sam commented Jul 6, 2021

Describe the bug
navi doesn't not recognize any cheat sheets.

To Reproduce
run navi, if current working directory is not at C:/ driver,

Expected behavior
It should NOT REWRITE disk driver character when query profile data

Screenshots

image

Versions:

  • OS: Windows
  • using any windows shell: navi 2.16.0

Additional context
sceenshot from procmon capture.

@neo-sam neo-sam added the bug Something isn't working label Jul 6, 2021
@welcome
Copy link

welcome bot commented Jul 6, 2021

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

@denisidoro
Copy link
Owner

Thanks for troubleshooting, but I'm afraid I didn't get it.

Do you mean that navi.exe should CreateFile in C:\Users\...\cheats but instead it's trying to create it in D:\Users\...\cheats which is invalid?

@neo-sam
Copy link
Author

neo-sam commented Jul 6, 2021

image

@denisidoro
Copy link
Owner

I believe this is a bug in https://docs.rs/directories-next/2.0.0/directories_next/struct.ProjectDirs.html#method.config_dir

I'll need to investigate this upstream

@scillidan
Copy link

I also had the similar problem.
I run it in Cmder.
image

@phanirithvij
Copy link

@scillidan I think you need to set cmd.exe as the shell in navi config. ref: #40 (comment)

zjp-CN added a commit to zjp-CN/navi that referenced this issue May 12, 2023
related to denisidoro#576

For the following config

cheats:
  paths:
    - C:\\Users\\Administrator\\AppData\\Roaming\\navi\\cheat
    - C:\\Users\\Administrator\\AppData\\Roaming\\navi\\cheat

navi now gets incorrect paths on Windows, since the seperator `:` for
path join is a valid component.

[2023-05-12T08:58:26Z DEBUG navi::commands::core] Filesystem(
        Some(
            "C:\\\\Users\\\\Administrator\\\\AppData\\\\Roaming\\\\navi\\\\cheat:C:\\\\Users\\\\Administrator\\\\AppData\\\\Roaming\\\\navi\\\\cheat",
        ),
    )
[2023-05-12T08:58:28Z DEBUG navi::filesystem] filesystem::Fetcher = Fetcher {
        path: Some(
            "C:\\\\Users\\\\Administrator\\\\AppData\\\\Roaming\\\\navi\\\\cheat:C:\\\\Users\\\\Administrator\\\\AppData\\\\Roaming\\\\navi\\\\cheat",
        ),
        files: RefCell {
            value: [],
        },
    }
@zjp-CN
Copy link
Contributor

zjp-CN commented May 12, 2023

This is caused by using : in path join

Some(p.join(":"))

let folders = paths_from_path_param(&interpolated_paths);

navi/src/filesystem.rs

Lines 25 to 27 in 6f316ec

fn paths_from_path_param(env_var: &str) -> impl Iterator<Item = &str> {
env_var.split(':').filter(|folder| folder != &"")
}

It's incorrect since : is a valid component on Windows. It'd be better to use PathBuf instead of String for path and carry the vec of path along.

Plus, I think we should introduce logging, otherwise it's hard to know where goes wrong. I made a small commit here zjp-CN@d1699df

@scillidan
Copy link

scillidan commented May 12, 2023

@phanirithvij

I started it from cmd.exe, and it seemed to be the same problem.

image

@zjp-CN
Copy link
Contributor

zjp-CN commented May 13, 2023

It's incorrect since : is a valid component on Windows. It'd be better to use PathBuf instead of String for path and carry the vec of path along.

Another workaround is to make the separator platform-specific. The PR is here.

image

@scillidan
Copy link

@zjp-CN Thanks! I will try it later.

denisidoro pushed a commit that referenced this issue Dec 10, 2023
related to #576

For the following config

cheats:
  paths:
    - C:\\Users\\Administrator\\AppData\\Roaming\\navi\\cheat
    - C:\\Users\\Administrator\\AppData\\Roaming\\navi\\cheat

navi now gets incorrect paths on Windows, since the seperator `:` for
path join is a valid component.

[2023-05-12T08:58:26Z DEBUG navi::commands::core] Filesystem(
        Some(
            "C:\\\\Users\\\\Administrator\\\\AppData\\\\Roaming\\\\navi\\\\cheat:C:\\\\Users\\\\Administrator\\\\AppData\\\\Roaming\\\\navi\\\\cheat",
        ),
    )
[2023-05-12T08:58:28Z DEBUG navi::filesystem] filesystem::Fetcher = Fetcher {
        path: Some(
            "C:\\\\Users\\\\Administrator\\\\AppData\\\\Roaming\\\\navi\\\\cheat:C:\\\\Users\\\\Administrator\\\\AppData\\\\Roaming\\\\navi\\\\cheat",
        ),
        files: RefCell {
            value: [],
        },
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants