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

Cygwin: Windows absolute paths not recognized as such #1136

Open
mtzguido opened this issue Dec 19, 2024 · 6 comments
Open

Cygwin: Windows absolute paths not recognized as such #1136

mtzguido opened this issue Dec 19, 2024 · 6 comments

Comments

@mtzguido
Copy link

Hi, I noticed that is_absolute does not return true for Windows paths when in a Cygwin environment. For instance the program below prints false, when I would expect a true.

let _ =
  let open BatPathGen.OfString in
  let fn = "C:\\a\\b\\c" in
  let path = of_string fn in
  print_endline (string_of_bool (is_absolute path))

I think this is due to this snippet, which simply does not check for "Cygwin" too:

let windows = match Sys.os_type with
| "Win32" -> true
| _ -> false

Is this intentional or maybe just an oversight...?

This was tested on a fresh Cygwin install with batteries 3.8.0, I can provide more info if needed.

@UnixJunkie
Copy link
Member

Do you have a proposed fix that you can test?

@UnixJunkie
Copy link
Member

I.e. a pull request. Not everybody has access to Cygwin.

@mtzguido
Copy link
Author

Yes I can test and submit a PR today, adding "Cygwin" above does seem to fix it. I'll add some unit tests too but I suppose there's no automated Cygwin test run?

@UnixJunkie
Copy link
Member

UnixJunkie commented Dec 20, 2024 via email

@UnixJunkie
Copy link
Member

If you can implement your proposed fix and test that it works; that's enough for me.

@mtzguido
Copy link
Author

Sorry for the delay, that does fix this immediate issue but causes some more paths to be printed in Windows format, which I suppose is not desirable. I'm also not well versed in Cygwin at all, trying to make some sense of it before sending a PR here.

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

No branches or pull requests

2 participants