FreeBSD Bugzilla – Attachment 25649 Details for
Bug 43810
'echo' is too big
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.71 KB, created by
kientzle
on 2002-10-08 05:00:11 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
kientzle
Created:
2002-10-08 05:00:11 UTC
Size:
2.71 KB
patch
obsolete
>diff --context echo.c-original echo.c >*** echo.c-original Mon Oct 7 20:44:50 2002 >--- echo.c Mon Oct 7 20:44:15 2002 >*************** >*** 45,52 **** > #include <sys/cdefs.h> > __FBSDID("$FreeBSD: src/bin/echo/echo.c,v 1.13 2002/06/30 05:13:53 obrien Exp >$"); > >- #include <stdio.h> >- #include <stdlib.h> > #include <string.h> > > /* ARGSUSED */ >--- 45,50 ---- >*************** >*** 56,62 **** > int nflag; /* if not set, output a trailing newline. */ > > /* This utility may NOT do getopt(3) option parsing. */ >! if (*++argv && !strcmp(*argv, "-n")) { > ++argv; > nflag = 1; > } >--- 54,60 ---- > int nflag; /* if not set, output a trailing newline. */ > > /* This utility may NOT do getopt(3) option parsing. */ >! if (*++argv && argv[0][0]=='-' && argv[0][1]=='n') { > ++argv; > nflag = 1; > } >*************** >*** 64,69 **** >--- 62,69 ---- > nflag = 0; > > while (argv[0] != NULL) { >+ size_t len; >+ len = strlen(argv[0]); > > /* > * If the next argument is NULL then this is this >*************** >*** 71,93 **** > * for a trailing \c. > */ > if (argv[1] == NULL) { >- size_t len; >- >- len = strlen(argv[0]); > /* is there room for a '\c' and is there one? */ > if (len >= 2 && > argv[0][len - 2] == '\\' && > argv[0][len - 1] == 'c') { > /* chop it and set the no-newline flag. */ >- argv[0][len - 2] = '\0'; > nflag = 1; > } > } >! (void)printf("%s", argv[0]); > if (*++argv) >! putchar(' '); > } > if (!nflag) >! putchar('\n'); > return 0; > } >--- 71,90 ---- > * for a trailing \c. > */ > if (argv[1] == NULL) { > /* is there room for a '\c' and is there one? */ > if (len >= 2 && > argv[0][len - 2] == '\\' && > argv[0][len - 1] == 'c') { > /* chop it and set the no-newline flag. */ > nflag = 1; >+ len -= 2; > } > } >! (void)write(1,argv[0],len); > if (*++argv) >! write(1," ",1); > } > if (!nflag) >! write(1,"\n",1); > return 0; > }
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 43810
: 25649