| Summary: | [patch] Incorrect example in wordexp(3) manpage | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Documentation | Reporter: | Jos Backus <jos> | ||||
| Component: | Books & Articles | Assignee: | Ceri Davies <ceri> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | Latest | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
State Changed From-To: open->patched Patched in -HEAD; thanks. Responsible Changed From-To: freebsd-doc->ceri State Changed From-To: patched->closed MFC'd to RELENG_6, apologies for forgetting this. |
The wordexp(3) manpage has an incorrect example: it uses pointer dereferencing whereas it should simply be accessing structure members: lizzy:/tmp% cat we.c #include <wordexp.h> int main(int argc, char **argv) { wordexp_t we; wordexp("${EDITOR:-vi} *.c /etc/motd", &we, 0); execvp(we->we_wordv[0], we->we_wordv); exit(0); } lizzy:/tmp% lizzy:/tmp% make we cc -O2 -fno-strict-aliasing -pipe we.c -o we we.c: In function `main': we.c:9: error: invalid type argument of `->' we.c:9: error: invalid type argument of `->' *** Error code 1 Stop in /tmp. lizzy:/tmp% Fix: Patch the manpage: