Author steve.dower
Recipients eryksun, giampaolo.rodola, jopamer, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware
Date 2018-09-19.23:12:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1537398756.05.0.956365154283.issue32557@psf.upfronthosting.co.za>
In-reply-to
Content
(Excuse the GitHub syntax - was about to post it there, but it got long enough to belong here)

Regarding the `_dirnameW` discussion, fixing `_dirname` would be ideal, but that is bloating out your PR quite a bit :)

The "right" function to use there is [PathCchRemoveFileSpec](https://docs.microsoft.com/en-us/windows/desktop/api/pathcch/nf-pathcch-pathcchremovefilespec), which unfortunately does not exist on Windows 7.

The fallback is [PathRemoveFileSpec](https://docs.microsoft.com/en-us/windows/desktop/api/shlwapi/nf-shlwapi-pathremovefilespeca) which only supports up to `MAX_PATH` (but may do something relatively sensible for longer paths, such as trimming out the last directory separator before that limit - I haven't tested it).

Supporting both is tricky - there's a similar example in `PC/getpathp.c` for `PathCchCombineEx` that could be replicated for dirname. But I'd be okay with taking this PR without that fix and filing a new bug for `_dirnameW`.
History
Date User Action Args
2018-09-19 23:12:36steve.dowersetrecipients: + steve.dower, terry.reedy, paul.moore, giampaolo.rodola, tim.golden, zach.ware, eryksun, jopamer
2018-09-19 23:12:36steve.dowersetmessageid: <1537398756.05.0.956365154283.issue32557@psf.upfronthosting.co.za>
2018-09-19 23:12:36steve.dowerlinkissue32557 messages
2018-09-19 23:12:35steve.dowercreate