Re: [dev] sbase TODO patch

2012-02-11 Thread Felix Janda
sed 's/rmdir/unlink/' rmdir.c unlink.c

Re: [dev] sbase TODO patch

2012-02-11 Thread clamiax
2012/2/11 Bjartur Thorlacius svartma...@gmail.com Shouldn't there be an utility that does both? A flag to rm, perhaps? +1

Re: [dev] sbase TODO patch

2012-02-11 Thread Felix Janda
On 02/11/12 at 12:07pm, Bjartur Thorlacius wrote: Þann lau 11.feb 2012 09:29, skrifaði Felix Janda: sed 's/rmdir/unlink/' rmdir.c unlink.c Shouldn't there be an utility that does both? A flag to rm, perhaps? What do you exactly mean? Which function of rmdir(1) and unlink(1) is rm(1)

Re: [dev] sbase TODO patch

2012-02-10 Thread Džen
http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/yes/yes.c?rev=1.8 -- Džen On 09/02/12 11:55pm, Lukas Fleischer wrote: On Thu, Feb 09, 2012 at 10:52:57PM +, Connor Lane Smith wrote: On 9 February 2012 22:44, Lukas Fleischer suckl...@cryptocrack.de wrote: Yeah. 'if (!argv[1]) argv[1]

Re: [dev] sbase TODO patch

2012-02-10 Thread clamiax
http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/yes/yes.c?rev=1.8.22.1content-type=text/x-cvsweb-markup 2012/2/10 Džen yvl...@gmail.com http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/yes/yes.c?rev=1.8 -- Džen On 09/02/12 11:55pm, Lukas Fleischer wrote: On Thu, Feb 09, 2012 at

Re: [dev] sbase TODO patch

2012-02-10 Thread Truls Becken
On 2012-02-09, at 23:52, Connor Lane Smith wrote: const char *s = (argc 2) ? y : argv[1]; while(puts(s) != EOF); On 2012-02-10, at 10:12, clamiax wrote: http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/yes/yes.c?rev=1.8.22.1content-type=text/x-cvsweb-markup How about: #include stdio.h

Re: [dev] sbase TODO patch

2012-02-10 Thread Džen
On 10/02/12 10:50am, Truls Becken wrote: [...] How about: #include stdio.h int main(int argc, char **argv) { const char *s = (argc 1) ? argv[1] : y; while(puts(s) != EOF); return 1; } +1

Re: [dev] sbase TODO patch

2012-02-10 Thread Paul Onyschuk
On Fri, 10 Feb 2012 07:52:54 -0500 Kurt H Maier khm-suckl...@intma.in wrote: out of curiosity, can someone explaing the #ifndef/#if nightmare that is occurring in this file? RCS markers (RCSid) are wrapped inside #ifdef to avoid spitting out compiler warnings, when they aren't used. You

Re: [dev] sbase TODO patch

2012-02-10 Thread clamiax
It's weird to read people who calls nightmare something they didn't understood.

Re: [dev] sbase TODO patch

2012-02-10 Thread Kurt H Maier
On Fri, Feb 10, 2012 at 07:52:54AM -0500, Kurt H Maier wrote: On Fri, Feb 10, 2012 at 10:12:35AM +0100, clamiax wrote: http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/yes/yes.c?rev=1.8.22.1content-type=text/x-cvsweb-markup out of curiosity, can someone explaing the #ifndef/#if nightmare that

Re: [dev] sbase TODO patch

2012-02-10 Thread stateless
On Thu, Feb 9, 2012 at 1:55 PM, Galos, David galos...@students.rowan.edu wrote: Hilarious. I particularly liked the way you needlessly reinvented getenv(), and pointlessly used getopt() in printenv. Heh, true. The use of getopt() was mainly for adding support for -0 in printenv. Although

Re: [dev] sbase TODO patch

2012-02-10 Thread Anthony J. Bentley
Paul Onyschuk writes: On Fri, 10 Feb 2012 07:52:54 -0500 Kurt H Maier khm-suckl...@intma.in wrote: out of curiosity, can someone explaing the #ifndef/#if nightmare that is occurring in this file? RCS markers (RCSid) are wrapped inside #ifdef to avoid spitting out compiler

Re: [dev] sbase TODO patch

2012-02-10 Thread Kurt H Maier
On Fri, Feb 10, 2012 at 10:04:24AM -0700, Anthony J. Bentley wrote: Most of them were stripped out of OpenBSD a couple years ago. The commit message by deraadt: Does anyone know if the netbsd guys still rely on them?

Re: [dev] sbase TODO patch

2012-02-10 Thread bch
On Fri, Feb 10, 2012 at 01:31:19PM -0500, Kurt H Maier wrote: On Fri, Feb 10, 2012 at 10:04:24AM -0700, Anthony J. Bentley wrote: Most of them were stripped out of OpenBSD a couple years ago. The commit message by deraadt: Does anyone know if the netbsd guys still rely on them? Can't

Re: [dev] sbase TODO patch

2012-02-09 Thread Rob
On Thu, Feb 09, 2012 at 12:15:32PM +, stateless wrote: Hi all, Implemented yes(1), sync(1) and printenv(1). Source is attached, haven't had time to write the manpage yet. Cheers, stateless These are slightly shorter and printenv() returns 1 when it can't find the environment variable.

Re: [dev] sbase TODO patch

2012-02-09 Thread Galos, David
malloc() in yes(1) is definitely overkill. I've attached a simple version. #include stdio.h int main(int argc, char **argv) { const char *y[] = {,y}; int i; if(argc 2) argv=y, argc=2; for(;;){ for(i=1; iargc; i++) printf(%s%s\n, argv[i], (i==argc-1)?: ); } }

Re: [dev] sbase TODO patch

2012-02-09 Thread Felix Janda
Hi, here is a version of rmdir(1) in the spirit of mkfifo.c. Felix#include stdlib.h #include unistd.h #include util.h int main(int argc, char *argv[]) { while(getopt(argc, argv, ) != -1) exit(EXIT_FAILURE); for(; optind argc; optind++) if(rmdir(argv[optind]) == -1) eprintf(remove %s:,

Re: [dev] sbase TODO patch

2012-02-09 Thread Lukas Fleischer
On Thu, Feb 09, 2012 at 04:06:59PM -0500, Galos, David wrote: malloc() in yes(1) is definitely overkill. I've attached a simple version. Invoking malloc() once (resulting in O(1) additional time and space) is overkill but using printf() in every iteration (which means firing up the printf()

Re: [dev] sbase TODO patch

2012-02-09 Thread Rob
On Thu, Feb 09, 2012 at 10:37:51PM +0100, Lukas Fleischer wrote: On Thu, Feb 09, 2012 at 04:06:59PM -0500, Galos, David wrote: malloc() in yes(1) is definitely overkill. I've attached a simple version. Invoking malloc() once (resulting in O(1) additional time and space) is overkill but

Re: [dev] sbase TODO patch

2012-02-09 Thread Connor Lane Smith
Do we really need multiple arguments for yes(1)? BSD doesn't. while(puts(argv[1]) != EOF); cls

Re: [dev] sbase TODO patch

2012-02-09 Thread Lukas Fleischer
On Thu, Feb 09, 2012 at 10:19:55PM +, Connor Lane Smith wrote: Do we really need multiple arguments for yes(1)? BSD doesn't. while(puts(argv[1]) != EOF); Yeah. 'if (!argv[1]) argv[1] = y;' and this gets a +1 from me :) cls

Re: [dev] sbase TODO patch

2012-02-09 Thread Connor Lane Smith
On 9 February 2012 22:44, Lukas Fleischer suckl...@cryptocrack.de wrote: Yeah. 'if (!argv[1]) argv[1] = y;' and this gets a +1 from me :) It'd probably be more like, const char *s = (argc 2) ? y : argv[1]; while(puts(s) != EOF); cls

Re: [dev] sbase TODO patch

2012-02-09 Thread Lukas Fleischer
On Thu, Feb 09, 2012 at 10:52:57PM +, Connor Lane Smith wrote: On 9 February 2012 22:44, Lukas Fleischer suckl...@cryptocrack.de wrote: Yeah. 'if (!argv[1]) argv[1] = y;' and this gets a +1 from me :) It'd probably be more like, const char *s = (argc 2) ? y : argv[1];

[dev] sbase TODO patch

2012-01-31 Thread Kurt H Maier
Might as well make my wishlist public. This is the stuff that would make sbase my fulltime coreutils replacement. I've tried to remove commands that boil down to simple shell scripts, but some might have snuck through. (Why is there a true.c? ATT did fine with a no-op shell script. Ditto