Re: issues with bsdgrep and lang/go

看板FB_current作者時間14年前 (2011/08/09 19:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/10 (看更多)
Alexander Best <arundel@freebsd.org> writes: > On Tue Aug 9 11, Test Rat wrote: >> Alexander Best <arundel@freebsd.org> writes: >> >> [...] >> > gmake -C 6g install >> > gmake[1]: Entering directory `/usr/ports/lang/go/work/go-20110515/src/cmd/6g' >> > quietgcc -I"/usr/ports/lang/go/work/go-20110515/include" -ggdb -O2 -c "/usr/ports/lang/go/work/go-20110515/src/cmd/6g/list.c" >> > egrep: : error: .Each undeclared identifier|: error: for each function >> > it appears|is dangerous, better use|is almost always misused|: In >> > function |: At top level: |In file included from| from: No such file >> > or directory >> >> Do you use GREP_OPTIONS? > > otaku% type $GREP_OPTIONS > otaku% echo foo | env -i GREP_OPTIONS= bsdgrep foo > env: bsdgrep: No such file or directory > otaku% Actually, it's lang/go that seems to set the environment variable. $ fgrep -r GREP_OPTIONS $(make -V WRKSRC) .../src/cmd/gc/mkopnames:export GREP_OPTIONS="" .../src/Make.inc:GREP_OPTIONS:= .../src/Make.inc:export LANG LC_ALL LC_CTYPE GREP_OPTIONS GREP_COLORS .../src/Make.inc: @echo export GREP_OPTIONS="$(GREP_OPTIONS)" .../test/run:unset GREP_OPTIONS # in case user has a non-standard set .../doc/devel/weekly.html:* build: clear custom variables like GREP_OPTIONS, Try below workaround. It also makes empty GREP_COLOR behave like gnugrep(1). %% Index: usr.bin/grep/grep.c =================================================================== --- usr.bin/grep/grep.c (revision 224705) +++ usr.bin/grep/grep.c (working copy) @@ -304,7 +304,7 @@ init_color(const char *d) char *c; c = getenv("GREP_COLOR"); - return (c != NULL ? c : d); + return (c != NULL && c[0] != '\0' ? c : d); } int @@ -360,7 +360,7 @@ main(int argc, char *argv[]) /* support for extra arguments in GREP_OPTIONS */ eargc = 0; - if (eopts != NULL) { + if (eopts != NULL && eopts[0] != '\0') { char *str; /* make an estimation of how many extra arguments we have */ @@ -373,6 +373,7 @@ main(int argc, char *argv[]) eargc = 0; /* parse extra arguments */ while ((str = strsep(&eopts, " ")) != NULL) + if(*str != '\0') eargv[eargc++] = grep_strdup(str); aargv = (char **)grep_calloc(eargc + argc + 1, %% _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1EGHgoKG (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1EGHgoKG (FB_current)