devkitPro / newlib

fork from sourceware git://sourceware.org / newlib-cygwin.git
https://devkitpro.org
GNU General Public License v2.0
22 stars 16 forks source link

Add realpath implementation to sysbase #23

Closed oreo639 closed 1 year ago

oreo639 commented 2 years ago

This adds a realpath() implementation to sysbase. Currently, the function for resolving the path is basically the same as used for chdir() (but without the / automatically added to the end ofc), if that needs to be changed, let me know.

One issue with this PR rn that it duplicates macros/variables defined in chmod.c, which I assume is not desirable. I'm not sure how best to fix that. Any suggestions would be appreciated.

If there are any other issues, please let me know.

WinterMute commented 1 year ago

I ended up going a bit further with the realpath implementation and allowing for symlinks here https://github.com/devkitPro/newlib/blob/devkitPro/libgloss/libsysbase/realpath.c

I did start from your implementation though so thanks for the PR

oreo639 commented 1 year ago

Thanks.