6 ms·
This is source code from 2011. Checking http://opensource.apple.com http://opensource.apple.com will show that it's not longer implemented this way in 10.10. H
by dxq 12y ago
This is source code from 2011. Checking http://opensource.apple.com http://opensource.apple.com will show that it's not longer implemented this way in 10.10.
Here's the current implementation: http://opensource.apple.com/source/Libc/Libc-1044.1.2/gen/FreeBSD/wordexp.c http://opensource.apple.com/source/Libc/Libc-1044.1.2/gen/Fr...
- Jaecen 12y agoCan you explain why wordexp.c on the referenced site has a completely different (and older) copyright? Did they merge in another implementation?
- dxq 12y agoI'm guessing that the linked implementation probably hadn't been touched since 2008. My comment that this was source code from 2011 was referring to the fact that this release of libc (Libc-763.11) is from 2011.
- mrpippy 12y agoThe current one is a derivative of NetBSD's implementation (where it shells out to use a sh builtin)
- dxq 12y agoJudging by both the source code and its placement in the repository (gen/FreeBSD/wordexp.c), I'm thinking it's a derivative of the FreeBSD implementation (which may itself be a derivative of the NetBSD implementation, or perhaps the other way around).
- JoachimS 12y agoYes, the OSX code seems to come from FreeBSD. Here is the FreeBSD version of the source: https://github.com/freebsd/freebsd/blob/master/lib/libc/gen/wordexp.c https://github.com/freebsd/freebsd/blob/master/lib/libc/gen/... It looks very similar to the current OSX file posted in an earlier comment. Calls /bin/sh too.
- lloeki 12y agoLicense-wise: - this piece of code is 2BSD-licensed - it calls out to /bin/sh - on OS X, /bin/sh is hardlinked to /bin/bash - OS X's bash is GPLv2 Forking to shell is the only way to reuse bash's code. More often than not I really wish sh were not bash.
- _ZeD_ 12y ago"Forking to shell is the only way to reuse bash's code." well, the other obvius way is to license this piece of code as GPLv2.
- yetihehe 12y agoAFAIK this is THE reason for GPL. So that you either release your code and contribute to open source or suffer from slower access methods.
- feld 12y agoThe BSDs doesn't ship with bash and their wordexp shelling out to /bin/sh doesn't suffer, so I don't see how this is a reason for the GPL.
- tedunangst 12y agoWhich would require libc to be GPL, something not even glibc does.