[Toybox] [PATCH] lib getdirname()

Jarno Mäkipää jmakip87 at gmail.com
Mon Oct 14 08:16:13 PDT 2019


This patch relates pull request created by E5ten
https://github.com/landley/toybox/pull/145


I would write getdirname() following way so it should output similar
output as libc dirname
but return always pointer that can be freed. You might have more
elegant solution but here is my take.

return similar dirnames as libc dirname
path       getdirname
/usr/lib/  /usr
/usr/lib   /usr
/usr/      /
usr        .
/          /
.          .
..         .
---
 lib/lib.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lib-getdirname.patch
Type: text/x-patch
Size: 886 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20191014/fe7cd685/attachment-0002.bin>


More information about the Toybox mailing list