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

Dir path bug #48

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Dir path bug #48

wants to merge 3 commits into from

Conversation

martin045k
Copy link
Contributor

Alternative fix to the dir path bug problem. This seemingly fixes the issue on Windows 10, though I have not tested the modifications on Linux / OS X or other Windows versions.

In essence, what these changes should do, is that in the new_command function of the driver, it performs a check to see, whether the OS is windows. If this is the case, it applies a custom formatting command (format_cmd), otherwise, it should proceed as before.

New commands:
clear_format: When parsed a string, it removes the singular . from the front if it is there, otherwise, if it is .. or more dots, it should not remove these. Then, after this, it will attempt to remove all consecutive / and \ reachable from the front and the back, which purpose is to eventually yield a string with some format where the leftmost part of the string is a folder name, and the rightmost part is also a folder name.

format_cmd: This cleans both the program's cmd path and user specified dir path with clear_format, then, if dir is a non-zero string, appends cmd path to the dir path, making sure to place a / between the two, which should be doable, since neither end or begin with a / or \. Likewise, it checks the dir path for a drive letter format, if not, then it appends ./ as would otherwise be there.

Hopefully this solves the problem, or at the very least, lets us move towards a more complete solution 🙂

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.

1 participant