Skip to content

[BUG] fileio add_mapping allows invalid physical path #133

Description

@dedmen

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,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugError, flaw, failure or fault that causes to produce an incorrect result or crash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions