The sound distributed version control system

#538 [patch] Windows path separator bugs

Closed on September 22, 2021
Altafen on September 15, 2021

On Windows, pijul doesn’t consistently use \ as a directory separator. I’m not sure if there are other places like this, but path::components only accepts \ and is sometimes given /.

Symptoms:

I don’t know if it’d be better to normalize paths more consistently, or to accept either slash like this patch does, but it does fix both symptoms. I’m pretty sure the Windows file APIs will accept either slash.

Altafen added a change on September 15, 2021
KCGMOAKSKV55GN22DC6JA572CMNLB2FWYCQJ7HU52PV76FDL556AC
main
pmeunier on September 22, 2021

Thanks! This is because paths come from different places:

  • Internally, we have UTF-8 strings for paths. Any other encoding is transcoded to UTF-8.
  • Some stuff comes from std::path::Path, in particular pushing and popping components.
  • There is a normalisation step when adding or recording files, but I don’t know how “normal” the normalised paths are, in particular I don’t know how the different moving parts align with each other on this issue.
pmeunier closed this discussion on September 22, 2021