[dev] Re: [sbase] sys/sysmacros.h and major/minor

2019-06-25 Thread Michael Forney
On 2019-06-25, Michael Forney wrote: > 1. Invert the ifdef by conditionally *omitting* the sysmacros.h > include on systems that don't have it rather than including it only on > glibc. I know this includes at least OpenBSD. Does anyone know of any > others? I think this includes most BSD operatin

Re: [dev] Re: [sbase] [PATCH] sort: Fix -u option

2016-03-13 Thread Dimitris Papastamos
On Sat, Mar 12, 2016 at 03:48:13PM -0800, Michael Forney wrote: > On Sat, Mar 12, 2016 at 11:46:31AM -0800, Michael Forney wrote: > > In eb9bda878736344d1bef06d42e57e96de542a663, a bug was introduced in the > > handling of -1 return values from getline. Since the type of the len > > field in struct

[dev] Re: [sbase] [PATCH] sort: Fix -u option

2016-03-12 Thread Michael Forney
On Sat, Mar 12, 2016 at 11:46:31AM -0800, Michael Forney wrote: > In eb9bda878736344d1bef06d42e57e96de542a663, a bug was introduced in the > handling of -1 return values from getline. Since the type of the len > field in struct line is unsigned, the break condition was never true. > This caused sor

Re: [dev] Re: [sbase] Portability

2015-11-26 Thread Dimitris Papastamos
On Thu, Nov 26, 2015 at 05:12:17AM -0500, Random832 wrote: > Dimitris Papastamos writes: > > sbase should only contain code that runs on POSIX systems (with some > > minor exceptions) and fallback implementations for non-standardized > > interfaces that can be implemented portably on top of POSIX

[dev] Re: [sbase] Portability

2015-11-26 Thread Random832
Dimitris Papastamos writes: > sbase should only contain code that runs on POSIX systems (with some > minor exceptions) and fallback implementations for non-standardized > interfaces that can be implemented portably on top of POSIX interfaces. So there's no place for fallback implementations _of_

Re: [dev] Re: [sbase] cal doesn't highlight current day

2015-11-21 Thread Dimitris Papastamos
On Fri, Nov 20, 2015 at 06:53:53PM +, Connor Lane Smith wrote: > On 20 November 2015 at 18:40, Connor Lane Smith wrote: > > I've attached a patch. It's not too bad, although it does have ugly > > escape codes. But I don't actually mind either way. > > Slightly uglier bugfix. I've applied the

Re: [dev] Re: [sbase] cal doesn't highlight current day

2015-11-20 Thread Connor Lane Smith
On 20 November 2015 at 18:40, Connor Lane Smith wrote: > I've attached a patch. It's not too bad, although it does have ugly > escape codes. But I don't actually mind either way. Slightly uglier bugfix. cls patch Description: Binary data

Re: [dev] Re: [sbase] cal doesn't highlight current day

2015-11-20 Thread Connor Lane Smith
On 20 November 2015 at 13:13, FRIGN wrote: > I think there should be no discussion without a patch. I don't want to see > anybody express his opinion here unless he has a patch in his attachments. I've attached a patch. It's not too bad, although it does have ugly escape codes. But I don't actual

Re: [dev] Re: [sbase] cal doesn't highlight current day

2015-11-20 Thread FRIGN
On Fri, 20 Nov 2015 08:08:26 -0500 Greg Reagle wrote: > I don't think we need to discuss anything. I think what's missing is a patch. > I think that a patch to highlight the current day would *probably* be accepted > (but I have no authority, just a regular user/developer). I think there should

Re: [dev] Re: [sbase] cal doesn't highlight current day

2015-11-20 Thread v4hn
On Fri, Nov 20, 2015 at 10:48:15AM -0200, Marc Collin wrote: > I really believe this would be a 0% complexity addition Don't believe but demonstrate. Did you write a patch yet? util-linux' cal manpage states: > the day will be highlighted if the calendar is displayed on a terminal. Go ahead. >

Re: [dev] Re: [sbase] cal doesn't highlight current day

2015-11-20 Thread Greg Reagle
I don't think we need to discuss anything. I think what's missing is a patch. I think that a patch to highlight the current day would *probably* be accepted (but I have no authority, just a regular user/developer).

Re: [dev] Re: [sbase] cal doesn't highlight current day

2015-11-20 Thread Marc Collin
Here's a screenshot that shows this (very simple) feature and how it's useful. What people think? I really believe this would be a 0% complexity addition and the usefulness would be very high. http://i.imgur.com/RQUz6cR.png Left is how it is. Right is how it could be (with current day highlighted).

[dev] Re: [sbase] cal doesn't highlight current day

2015-11-16 Thread Christian Neukirchen
Manu Raster writes: > Marc Collin writes: > >> It's one of the commands I use the most, and having the current day >> highlighted is a pretty great feature. > > Another really useful function would be an optional column in the > calendar displaying 'ISO week dates' (DIN ISO 8601). They are quite

[dev] Re: [sbase] cal doesn't highlight current day

2015-11-16 Thread Manu Raster
Marc Collin writes: > It's one of the commands I use the most, and having the current day > highlighted is a pretty great feature. Another really useful function would be an optional column in the calendar displaying 'ISO week dates' (DIN ISO 8601). They are quite common in business parlance but

[dev] Re: [sbase][patch] add [ alias to test, makefile cleanup

2015-02-20 Thread Evan Gates
And of course I forgot to remove [ on uninstall. One more patch to do that. -emg From a2145f934990b56b17c1faa564142b1bad42396f Mon Sep 17 00:00:00 2001 From: Evan Gates Date: Fri, 20 Feb 2015 14:02:12 -0800 Subject: [PATCH] remember to remove [ on uninstall --- Makefile | 4 ++-- 1 file changed,

[dev] Re: [sbase] [PATCH] ls: List directory contents if file is a symlink to a directory

2014-12-07 Thread Michael Forney
On Sun, Dec 07, 2014 at 10:40:42PM +, Michael Forney wrote: > --- > ls.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/ls.c b/ls.c > index b48391b..90193cc 100644 > --- a/ls.c > +++ b/ls.c > @@ -21,6 +21,7 @@ typedef struct { > off_t size; > time_t mt

Re: [dev] Re: [sbase] [patch] Adding tar v2

2013-07-18 Thread Galos, David
With Truls' modifications, I have applied the patch. Sbase now has tar. Test away, Dave

[dev] Re: [sbase] [patch] Adding tar v2

2013-07-17 Thread Christian Neukirchen
Nick writes: > On Wed, Jul 17, 2013 at 04:50:03PM +, Bjartur Thorlacius wrote: >> If you're just interacting with >> a shell, you should be using a simple I/O text window, with or >> without autocompletion. > > I would very much like this to exist, using non-monospaced fonts. It > wouldn't be

[dev] Re: [sbase] [patch] Adding tar v2

2013-07-12 Thread Galos, David
And, here is that patch that I stupidly forgot to attach. sbase-adding-tar-2.diff Description: Binary data

Re: [dev] Re: sbase

2011-06-16 Thread Rob
On 16 June 2011 02:18, Connor Lane Smith wrote: > An update: I've done this, and added it to the Makefile. It's a little > simpler than doing it by concatenating all the sources, since we don't > need to worry about statics or anything. Currently sbase-box comes out > at 69K statically linked agai

Re: [dev] Re: sbase

2011-06-15 Thread Connor Lane Smith
On 11 June 2011 00:40, Connor Lane Smith wrote: > Why not just edit the individual files' main() functions (in a build > directory) and generate a main.c, compile them, and link the object > files together? Don't have to worry about anything except main(), > then. An update: I've done this, and a

Re: [dev] Re: sbase

2011-06-10 Thread Connor Lane Smith
On 9 June 2011 23:24, pancake wrote: > support for string mode format in chmod. Now you can do stuff like chmod +x > .. g-rwx , ... I got round to looking at this. I had to change some of it to make it POSIX and so on, but I like the approach (which basically avoids the POSIX's BNF grammar (seri

Re: [dev] Re: sbase

2011-06-10 Thread Rob
On 10 June 2011 06:55, pancake wrote: > On 10/06/2011, at 4:26, Connor Lane Smith wrote: >> No, there's no bug here; size is allocated and memset on the next line. > > Your gcc sucks. Mine reports the error here. Size is only allocated if the > or condition applies which is not something to alway

Re: [dev] Re: sbase

2011-06-10 Thread Rob
On 10 June 2011 14:23, Rob wrote: > Anyway, I had another pop this morning and here's what I got. Also, forgot to mention, you'll need to alter true.c, false.c and tty.c so their main conforms, otherwise it won't compile.

Re: [dev] Re: sbase

2011-06-10 Thread Rob
On 10 June 2011 04:30, Connor Lane Smith wrote: > The only way this is going to happen is if someone writes a script > which does it automatically, by going through each utility prefixing > their main() functions (in a separate build directory), generating a > common main() which dispatches to the

Re: [dev] Re: sbase

2011-06-10 Thread pancake
On 06/10/11 14:25, Connor Lane Smith wrote: Hey, On 10 June 2011 06:55, pancake wrote: Your gcc sucks. Mine reports the error here. Size is only allocated if the or condition applies which is not something to always happen opening the doors to use an uninitialized pointer. I wasn't talking ab

Re: [dev] Re: sbase

2011-06-10 Thread Connor Lane Smith
Hey, On 10 June 2011 06:55, pancake wrote: > Your gcc sucks. Mine reports the error here. Size is only allocated if the > or condition applies which is not something to always happen opening the > doors to use an uninitialized pointer. I wasn't talking about GCC. Step through the logic in your h

Re: [dev] Re: sbase

2011-06-10 Thread Szabolcs Nagy
* Anthony J. Bentley [2011-06-09 19:22:47 -0600]: > Don???t we have /dev/stdin for that anyway? > no /dev/stdin, /dev/fd/0, /proc/self/fd/0 are non standard and not always available (even on linux systems)

Re: [dev] Re: sbase

2011-06-09 Thread pancake
Hi On 10/06/2011, at 4:26, Connor Lane Smith wrote: > On 9 June 2011 23:24, pancake wrote: >> support for string mode format in chmod. Now you can do stuff like chmod +x >> .. g-rwx , ... > > Thanks, I'll get round to looking at this tomorrow. > >> fix uninitialized bug in tail > > No, ther

Re: [dev] Re: sbase

2011-06-09 Thread Connor Lane Smith
On 9 June 2011 23:25, pancake wrote: > What do you think about creating a single main() in sbase.c that works like > busybox (as a proxy for the rest of binaries) i think this can be interesting > for embeddeds. So reading symlink of argv0 and act accordingly. The only way this is going to happ

Re: [dev] Re: sbase

2011-06-09 Thread Connor Lane Smith
On 9 June 2011 23:24, pancake wrote: > support for string mode format in chmod. Now you can do stuff like chmod +x > .. g-rwx , ... Thanks, I'll get round to looking at this tomorrow. > fix uninitialized bug in tail No, there's no bug here; size is allocated and memset on the next line. > sim

Re: [dev] Re: sbase

2011-06-09 Thread Connor Lane Smith
On 10 June 2011 02:32, Connor Lane Smith wrote: > Thanks. I actually decided the name system is better, since only that > is required by POSIX Though we can allow signums for '-s', despite its not being strictly POSIX. cls

Re: [dev] Re: sbase

2011-06-09 Thread Connor Lane Smith
On 9 June 2011 16:28, Rob wrote: > I was wondering whether to do that or not, it's pretty useful but > there's a fair bit more code. I'll leave it to cls to decide. Thanks. I actually decided the name system is better, since only that is required by POSIX, and it means we can use the same arg par

Re: [dev] Re: sbase

2011-06-09 Thread Anthony J. Bentley
On Thu, Jun 9, 2011 at 6:58 PM, Connor Lane Smith wrote: > On 9 June 2011 13:40, stateless wrote: >> Attached cmp.c and cmp.1. > > Thanks! I'm also not bothering with '-', so I took that out, which > meant we could simplify the code a lot. Don’t we have /dev/stdin for that anyway? -- Anthony J.

Re: [dev] Re: sbase

2011-06-09 Thread Connor Lane Smith
On 9 June 2011 13:40, stateless wrote: > Attached cmp.c and cmp.1. Thanks! I'm also not bothering with '-', so I took that out, which meant we could simplify the code a lot. cls

Re: [dev] Re: sbase

2011-06-09 Thread Kurt H Maier
On Thu, Jun 9, 2011 at 6:25 PM, pancake wrote: > What do you think about creating a single main() in sbase.c that works like > busybox (as a proxy for the rest of binaries) i think this can be interesting > for embeddeds. So reading symlink of argv0 and act accordingly. please for the love of g

Re: [dev] Re: sbase

2011-06-09 Thread pancake
What do you think about creating a single main() in sbase.c that works like busybox (as a proxy for the rest of binaries) i think this can be interesting for embeddeds. So reading symlink of argv0 and act accordingly. On 09/06/2011, at 17:28, Rob wrote: > On 9 June 2011 16:06, Hiltjo Posthuma

Re: [dev] Re: sbase

2011-06-09 Thread pancake
Here's my contribution: * support for string mode format in chmod. Now you can do stuff like chmod +x .. g-rwx , ... * fix uninitialized bug in tail * simplify sleep() -- do not use getopt here. The chmod patch is not complete at all, but works much better and +x is something many ppl use. Abo

Re: [dev] Re: sbase

2011-06-09 Thread Rob
On 9 June 2011 16:06, Hiltjo Posthuma wrote: > I like it, but what about -signalnumber (and maybe -signalname), I use > -9 all the time :) I was wondering whether to do that or not, it's pretty useful but there's a fair bit more code. I'll leave it to cls to decide. #include #include #include

Re: [dev] Re: sbase

2011-06-09 Thread Hiltjo Posthuma
> > Ah man, I've just been doing kill.c myself. Lowest SLOC count makes it > into base? > I like it, but what about -signalnumber (and maybe -signalname), I use -9 all the time :)

Re: [dev] Re: sbase

2011-06-09 Thread stateless
No worries Rob! :)

Re: [dev] Re: sbase

2011-06-09 Thread Rob
On 9 June 2011 13:54, stateless wrote: > Arrgh fucking gmail. +1 #include #include #include #include #include "util.h" int main(int argc, char *argv[]) { int sig = SIGTERM; char c, *end; while((c = getopt(argc, argv, "s:")) != -1) switch(c){ case 's': sig = strtol(optarg, &end, 0)

Re: [dev] Re: sbase

2011-06-09 Thread Rob
On 9 June 2011 13:48, stateless wrote: > Hi, > > Just to be on the same page and we don't start working on the same > tools.  I'll look into implementing id, kill and comm. > > Thanks, > stateless Ah man, I've just been doing kill.c myself. Lowest SLOC count makes it into base? #include #include

Re: [dev] Re: sbase

2011-06-09 Thread stateless
Arrgh fucking gmail. /* See LICENSE file for copyright and license details. */ #include #include #include #include #include #include "util.h" static bool lflag = false; static bool sflag = false; int main(int argc, char *argv[]) { FILE *fp0, *fp1; int c; int line, byte; int ch0, ch1; in

Re: [dev] Re: sbase

2011-06-09 Thread stateless
Small update, attached cmd.c and cmd.1. /* See LICENSE file for copyright and license details. */ #include #include #include #include #include #include "util.h" static bool lflag = false; static bool sflag = false; int main(int argc, char *argv[]) { FILE *fp0, *fp1; int c; int line, byte;

Re: [dev] Re: sbase

2011-06-09 Thread stateless
Hi, Just to be on the same page and we don't start working on the same tools. I'll look into implementing id, kill and comm. Thanks, stateless

Re: [dev] Re: sbase

2011-06-09 Thread stateless
Attached cmp.c and cmp.1. /* See LICENSE file for copyright and license details. */ #include #include #include #include #include #include "util.h" static bool lflag = false; static bool sflag = false; int main(int argc, char *argv[]) { FILE *fp0, *fp1; int c; int line, byte; int ch0, ch1

[dev] Re: sbase

2011-06-08 Thread Connor Lane Smith
Hey, For anyone interested in helping out with sbase, I've pushed a TODO file containing all the commands I think we need to implement, at least to begin with. I'll be working on these whenever I have free time, and if anyone else could help that would be great. Thanks, cls

Re: [dev] Re: sbase

2011-05-26 Thread Kurt H Maier
Here is a half-assed old version of chmod, in the vein of v5 chmod. It has a man page and informative ed-style error messages, but no recursion or POSIX-style 'symbolic mode expressions.' I'll refactor it to use util/recurse later. I don't really care about 'symbolic mode expressions.' -- # Kur

Re: [dev] Re: sbase

2011-05-26 Thread pancake
The tac.c i pushed few time ago is magnitudes faster than awk. That was the reasom why nibble and me wrote it. On 26/05/2011, at 20:45, markus schnalke wrote: > [2011-05-26 07:39] Anselm R Garbe >> >> Afaik tac sucks more, as it is quite an arbitrary command, not part of >> Plan 9 and can be

Re: [dev] Re: sbase

2011-05-26 Thread markus schnalke
[2011-05-26 07:39] Anselm R Garbe > > Afaik tac sucks more, as it is quite an arbitrary command, not part of > Plan 9 and can be imitated with a awk one liner like > > awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' Okay, but who want's to type this line by hand? IMO tac *should be in

Re: [dev] Re: sbase

2011-05-26 Thread Connor Lane Smith
On 26 May 2011 07:39, Anselm R Garbe wrote: > As for sbase I'm still sceptical this is a good idea as it > re-implements perfectly sound 9base tools, but avoids the real tricky > ones such as rc, mk or awk. I, basically, disagree. The Plan 9 tools were written for another operating system: ls has

Re: [dev] Re: sbase

2011-05-25 Thread Anselm R Garbe
On 26 May 2011 07:18, pancake wrote: > What about cat and tac? I already pushed tac to 9base few time ago, but it > was removed.. It fits better in sbase. Afaik tac sucks more, as it is quite an arbitrary command, not part of Plan 9 and can be imitated with a awk one liner like awk '{a[i++]=$0}

Re: [dev] Re: sbase

2011-05-25 Thread pancake
What about cat and tac? I already pushed tac to 9base few time ago, but it was removed.. It fits better in sbase. On 26/05/2011, at 7:19, Connor Lane Smith wrote: > Update! > > We've got 20 utilities now: basename, cat, chown, date, dirname, echo, > false, grep, head, ln, ls, mkdir, mkfifo, pw

[dev] Re: sbase

2011-05-25 Thread Connor Lane Smith
Update! We've got 20 utilities now: basename, cat, chown, date, dirname, echo, false, grep, head, ln, ls, mkdir, mkfifo, pwd, rm, sleep, tee, touch, true, and wc. I think the most crucial ones missing are chmod, cp, mv, seq, sort, tail, test, and uniq. And probably others. Working on it! I've bee

Re: [dev] Re: sbase

2011-05-25 Thread Rafa Garcia Gallego
On Wed, May 25, 2011 at 10:54 AM, pancake wrote: > On 05/24/11 19:12, Rafa Garcia Gallego wrote: >> >> On Tue, May 24, 2011 at 6:16 PM, Christian Neukirchen >>  wrote: >>> >>> Remotely reminds me of http://code.google.com/p/aoeui/ which also is >>> pretty lightweight, has UTF8, is binary-safe, an

Re: [dev] Re: sbase

2011-05-25 Thread pancake
On 05/24/11 19:12, Rafa Garcia Gallego wrote: On Tue, May 24, 2011 at 6:16 PM, Christian Neukirchen wrote: Remotely reminds me of http://code.google.com/p/aoeui/ which also is pretty lightweight, has UTF8, is binary-safe, and has infinite undo. ~7KLOC, no curses dependency. This reminds me of

Re: [dev] Re: sbase

2011-05-24 Thread Rafa Garcia Gallego
On Tue, May 24, 2011 at 6:16 PM, Christian Neukirchen wrote: > Remotely reminds me of http://code.google.com/p/aoeui/ which also is > pretty lightweight, has UTF8, is binary-safe, and has infinite > undo. ~7KLOC, no curses dependency. This reminds me of my very own sandy[1]. Sorry for the blatant

[dev] Re: sbase

2011-05-24 Thread Christian Neukirchen
Kurt H Maier writes: > On Mon, May 23, 2011 at 8:58 PM, Connor Lane Smith wrote: >> Looking forward to it. imo we need a new editor... > > I like this: > http://www.stabie-soft.com/sre/re.html > > it's no sam, but for short one-off edits (or even as a pager) I like > it. Remotely reminds me of