FreeBSD Bugzilla – Attachment 78608 Details for
Bug 113049
[patch] [request] make quot(8) use getopt(3) and show usage() if no arguments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.27 KB, created by
Ighighi
on 2007-05-27 08:10:02 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Ighighi
Created:
2007-05-27 08:10:02 UTC
Size:
1.27 KB
patch
obsolete
>--- src/usr.sbin/quot/quot.c.orig Sat Oct 14 23:28:54 2006 >+++ src/usr.sbin/quot/quot.c Sun May 27 02:48:20 2007 >@@ -616,42 +616,48 @@ > char dev[MNAMELEN + 1]; > char *nm; > int cnt; >+ int ch; >+ >+ if (argc == 1) >+ usage(); > > func = douser; > #ifndef COMPAT > header = getbsize(&headerlen,&blocksize); > #endif >- while (--argc > 0 && **++argv == '-') { >- while (*++*argv) { >- switch (**argv) { >- case 'n': >- func = donames; >- break; >- case 'c': >- func = dofsizes; >- break; >- case 'a': >- all = 1; >- break; >- case 'f': >- count = 1; >- break; >- case 'h': >- estimate = 1; >- break; >+ >+ while ((ch = getopt(argc, argv, "acfhknv")) != -1) { >+ switch (ch) { >+ case 'a': >+ all = 1; >+ break; >+ case 'c': >+ func = dofsizes; >+ break; >+ case 'f': >+ count = 1; >+ break; >+ case 'h': >+ estimate = 1; >+ break; > #ifndef COMPAT >- case 'k': >- blocksize = 1024; >- break; >+ case 'k': >+ blocksize = 1024; >+ break; > #endif /* COMPAT */ >- case 'v': >- unused = 1; >- break; >- default: >- usage(); >- } >+ case 'n': >+ func = donames; >+ break; >+ case 'v': >+ unused = 1; >+ break; >+ default: >+ usage(); > } > } >+ argc -= optind; >+ argv += optind; >+ > if (all) { > cnt = getmntinfo(&mp,MNT_NOWAIT); > for (; --cnt >= 0; mp++) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 113049
: 78608