docs/95059: Incorrect example in wordexp(3) manpage

看板FB_doc作者時間20年前 (2006/03/29 08:10), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
>Number: 95059 >Category: docs >Synopsis: Incorrect example in wordexp(3) manpage >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 29 00:10:13 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Jos Backus >Release: -current >Organization: >Environment: FreeBSD lizzy.catnook.local 7.0-CURRENT FreeBSD 7.0-CURRENT #20: Sun Mar 19 17:20:05 PST 2006 root@lizzy.catnook.local:/usr/obj/usr/src/sys/LIZZY i386 >Description: 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% >How-To-Repeat: >Fix: Patch the manpage: --- wordexp.3.orig Tue Mar 28 15:36:44 2006 +++ wordexp.3 Tue Mar 28 15:37:15 2006 @@ -167,7 +167,7 @@ wordexp_t we; wordexp("${EDITOR:-vi} *.c /etc/motd", &we, 0); -execvp(we->we_wordv[0], we->we_wordv); +execvp(we.we_wordv[0], we.we_wordv); .Ed .Sh DIAGNOSTICS Diagnostic messages from the shell are written to the standard error output >Release-Note: >Audit-Trail: >Unformatted: _______________________________________________ freebsd-doc@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-doc To unsubscribe, send any mail to "freebsd-doc-unsubscribe@freebsd.org"
文章代碼(AID): #14AT1q00 (FB_doc)