Bug 95059

Summary: [patch] Incorrect example in wordexp(3) manpage
Product: Documentation Reporter: Jos Backus <jos>
Component: Books & ArticlesAssignee: Ceri Davies <ceri>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Jos Backus 2006-03-29 01:10:13 UTC
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:
Comment 1 Ceri Davies freebsd_committer freebsd_triage 2006-04-18 22:37:42 UTC
State Changed
From-To: open->patched

Patched in -HEAD; thanks. 


Comment 2 Ceri Davies freebsd_committer freebsd_triage 2006-04-18 22:37:42 UTC
Responsible Changed
From-To: freebsd-doc->ceri
Comment 3 Ceri Davies freebsd_committer freebsd_triage 2006-10-07 16:07:31 UTC
State Changed
From-To: patched->closed

MFC'd to RELENG_6, apologies for forgetting this.