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

[BUG] fileio add_mapping allows invalid physical path #133

Open
dedmen opened this issue Nov 17, 2020 · 0 comments
Open

[BUG] fileio add_mapping allows invalid physical path #133

dedmen opened this issue Nov 17, 2020 · 0 comments
Labels
bug Error, flaw, failure or fault that causes to produce an incorrect result or crash

Comments

@dedmen
Copy link
Contributor

dedmen commented Nov 17, 2020

Describe the bug


code uses size + 1 (+1 for the ending slash) and thus expects that phys path doesn't have endling slash.
but add_mapping doesn't verify/fix that if you do
add_mapping("T:/", "/")
it keeps the ending slash, which makes this code in screenshot trim one character too many.

so tree->physical now has "T:/" entry, but should just be "T:"

To Reproduce
Steps to reproduce the behavior:

  1. Make pdrive
    2, add_mapping("P:/", "/")
  2. try to compile P:/a3/functions_f_enoch/em_core/fn_showspectrumanalyzer.sqf
  3. include not found error for #include "define.inc"

Expected behavior
add_mapping should verify/remove trailing slash on physical path.
or get_info_physical should assume that folder path always ends with trailing slash, and add_mapping should also be adjusted for that,

@dedmen dedmen added the bug Error, flaw, failure or fault that causes to produce an incorrect result or crash label Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Error, flaw, failure or fault that causes to produce an incorrect result or crash
Projects
None yet
Development

No branches or pull requests

1 participant