Re: [dev] Special target ".POSIX" in Makefiles

2021-12-31 Thread Michael Forney
On 2021-12-30, NRK wrote: > Hmm, I was under the impression that `?=` was accepted into POSIX. But I > cannot find any mention of it in the posix manpage (man 1p make) so I > guess I was wrong. It is accepted for the upcoming POSIX issue 8: https://austingroupbugs.net/view.php?id=330

Re: [dev] tlsrp: a simple TLS reverse proxy

2020-07-05 Thread Michael Forney
On 2020-07-05, Nihal Jere wrote: > I wrote a very simple TLS reverse proxy which can be used as a companion > to quark. Essentially, it just turns quark's HTTP into HTTPS. It depends > only on libtls (from LibreSSL) and libbsd (for strlcpy). Seems like a neat project. Have you considered using me

Re: [dev] [sdhcp] The problem with renewals

2020-04-07 Thread Michael Forney
On 2020-03-16, Laslo Hunhold wrote: > Would you be open to work on a small patchset for it reflecting your > proposals? But before you do that, we might also just want to wait for > feedback by Michael Forney, who seems to be the current active > maintainer. I'm not the maintain

Re: [dev] [sbase] [ed] A couple of notes

2020-04-05 Thread Michael Forney
On 2020-03-22, Hiltjo Posthuma wrote: > Maybe it's an idea to just place issues in a TODO file in the repository? That's a good idea, thanks. I added a section with the issues reported by Cág, some existing items from ed.c, and a few others I have noticed.

Re: [dev] [sbase] [ed] A couple of notes

2020-03-21 Thread Michael Forney
On 2020-03-21, Hiltjo Posthuma wrote: > What kind of tracker? Did you see my other reply? https://lists.suckless.org/dev/2003/33827.html >I think discussions of suckless projects should stay > on the mailinglist and/or IRC, not an external bugtracker or something. Would suckless.org consider ho

Re: [dev] [sbase] [ed] A couple of notes

2020-03-21 Thread Michael Forney
On 2020-03-17, Hiltjo Posthuma wrote: > Where is the patch? I know it's contrary to the opinion of a lot of people here, but personally, I have no issue with bug reports without a patch. Sometimes people just don't have the time to investigate the issue and come up with a fix. It could even be th

Re: [dev] [sbase] [ed] A couple of notes

2020-03-21 Thread Michael Forney
On 2020-03-17, Cág wrote: > There are a couple things I've come across the > sbase's version of ed: > 1. w doesn't print the byte count. Suppose a sample > ed session (using P to distinguish my input from ed's > output): > % ed > P > *a > milk > bread > eggs > meat > veggies > bananas > apples >

Re: [dev] [sbase] sed 'd' command after 'r' or 'a' (POSIX interpretation question)

2020-01-17 Thread Michael Forney
On 2020-01-17, Quentin Rameau wrote: >> Perhaps we should bring this up on the austin group list and get them >> to clarify the text. > > Done, let's wait and see. Thanks, Quentin! For anyone following, the clarification request is at https://www.austingroupbugs.net/view.php?id=1319

[dev] [sbase] sed 'd' command after 'r' or 'a' (POSIX interpretation question)

2020-01-17 Thread Michael Forney
Hello, I recently ran into a package (dialog), which uses the following sed script to generate its dlg_config.h header: /@DEFS@/r conftest.frag /@DEFS@/d The intention is to replace @DEFS@ in the header template with the contents of a file. However, sbase sed skips writing the contents of the fi

Re: [dev] [sbase] chmod -R and symbolic links

2019-12-28 Thread Michael Forney
On 2019-12-23, Laslo Hunhold wrote: > On Sat, 21 Dec 2019 19:05:45 -0800 > Michael Forney wrote: > > Dear Michael, > >> I can think of two possibilities here: >> >> 1. Remove the -H, -L, and -P options from chmod, always set r.follow = >> 'H

Re: [dev] [sbase] wc output formatting

2019-12-21 Thread Michael Forney
On 2019-11-03, Silvan Jegen wrote: > I assume it's the leading whitespace that was the problem since here[0] > the output format is given as > > "%d %d %d %s\n", , , , > > > Considering this and that [0] doesn't mention anything about alignment, > just having "%zu %zu %zu %s\n" as before seems li

[dev] [sbase] chmod -R and symbolic links

2019-12-21 Thread Michael Forney
Hi, I'm looking into improving chmod(1) behavior with symbolic links. First, some background: - The mode of symbolic links is not used anywhere, and on linux, fchmodat(AT_FDCWD, path, mode, AT_SYMLINK_NOFOLLOW) on a symlink returns EOPNOTSUPP. - POSIX only specifies the -R option, and doesn't say

[dev] [sbase] wc output formatting

2019-11-02 Thread Michael Forney
Hi, I was looking through wc.c in sbase and noticed a couple curious things about the output formatting. POSIX says the tool should write "%d %d %d %s\n", , , , When the tool was first written, it used fixed field widths, presumably to maintain alignment when multiple files were specifi

[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

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

2019-06-25 Thread Michael Forney
Since glibc 2.28, sys/types.h no longer includes sys/sysmacros.h which defines the major and minor macros. Some BSDs don't have sys/sysmacros.h, so sbase has been conditionally including sys/sysmacros.h on glibc since 99c78763[0]. However, in the upcoming musl release, it too will remove the sys/s

[dev] [ubase] Fixing passwd crash

2019-06-25 Thread Michael Forney
I noticed that when passwd in ubase is changing a password, it will try to dereference a NULL pointer when /etc/shadow exists, but the user's password is not stored in /etc/shadow (i.e. marked with "x" in /etc/passwd). It will try to save the spw entry if /etc/shadow exists, even if the shadow entr

Re: [dev] dwm alpha patch: const isn't a const??

2019-05-26 Thread Michael Forney
On 2019-05-26, Paul Swanson wrote: > Hello, > > I've a fresh clone of dwm and the dwm alpha patch (20180613-b69c870) and > it's generating > the following error: > > dwm.c > In file included from dwm.c:280:0: > config.h:24:27: error: initializer element is not constant >

Re: [dev] Yet another C compiler

2019-05-20 Thread Michael Forney
On 2019-05-20, sylvain.bertr...@gmail.com wrote: > Sadly, gcc-4.7 does not have an aarch64 backend and it's a pain to > configure > without breaking anything. I wonder what the state of ARM/aarch64-4.7-branch is: https://gcc.gnu.org/viewcvs/gcc/branches/ARM/aarch64-4.7-branch/ It doesn't look li

[dev] Yet another C compiler

2019-05-19 Thread Michael Forney
Hi all, I know there are a number of small C compilers out there in various states of completion, but recently I've been working on another to add to the mix: https://git.sr.ht/~mcf/cc It is a C11 compiler based on QBE. The name is not yet chosen. I hope to differentiate it from the others by fo

Re: [dev] key-value config reader

2019-05-12 Thread Michael Forney
On 2019-05-12, Markus Wichmann wrote: > On Sat, May 11, 2019 at 08:52:32PM +0100, Piotr Oleskiewicz wrote: >> I would prefer to >> write >> >> X(int, i, 1) >> >> rather than >> >> X(int, i, atoi, "%d", 1) >> >> Many thanks, >> Piotr >> > > That is going to be tough, as in C in a macro, t

Re: [dev] miniyacc

2019-05-08 Thread Michael Forney
On 2019-05-08, Daniel Cegiełka wrote: > • lack of {% and %} which is quite common (license): > https://github.com/openbsd/src/blob/master/usr.bin/awk/awkgram.y > • I don't even know what else: > https://github.com/9fans/plan9port/blob/master/src/cmd/hoc/hoc.y#L32 I think these are both the s

Re: [dev] miniyacc

2019-05-08 Thread Michael Forney
eem to handle escape sequences in literals (i.e. '\n'). After working around those issues, I get a different error $n has no type (on line 171) I think this is due to the usage of $2 referring to a token (EQOP in this case) rather than a non-terminal. I haven't investigated t

Re: [dev][sdhcp] more updates

2019-02-02 Thread Michael Forney
On 2019-02-02, Sean MacLennan wrote: > First a question: how portable do we want things? The current sdhcp > works only on Linux. I think that depends on how feasible it is to make it portable without relying on a bunch of ifdefs to support different platforms. In terms of timerfd, I think it sh

Re: [dev] using vis (libtermkey) and netbsd-curses (was: oasis: small linux system inspired by stali)

2018-11-24 Thread Michael Forney
Hi Daniel, On 2018-11-24, Daniel Cegiełka wrote: > Hi, > > https://lists.suckless.org/dev/1811/33025.html > > I prepared a more detailed description of how to compile vis + > netbsd-curses. > > 1) copy from ncurses/ncurses/names.c strnames & strfnames: > > DCL(strnames) = { > "cbt", > "be

Re: [dev] [sdhcp] Part 1/3 Bugs

2018-11-14 Thread Michael Forney
On 2018-11-12, Sean MacLennan wrote: > I am surprised you are getting away with binding the socket to the > broadcast address. I found in ip(7): INADDR_BROADCAST (255.255.255.255) means any host and has the same effect on bind as INADDR_ANY for historical reasons. So that explains why it wo

Re: [dev] GPL free Linux

2018-11-14 Thread Michael Forney
On 2018-11-13, Markus Wichmann wrote: > On Mon, Nov 12, 2018 at 01:14:38PM -0800, Michael Forney wrote: >> Usually how it works is either the display server itself needs to be >> setuid to open those input devices, or some other program (commonly >> systemd-logind) needs to

Re: [dev] GPL free Linux

2018-11-12 Thread Michael Forney
On 2018-11-12, Alessandro Pistocchi wrote: > What is swc? My wayland compositor library: https://github.com/michaelforney/swc > Where can I find oasis? Would you be interested in helping a bit if I needed > help starting from oasis and removing gpl/lgpl stuff? I am ok with gpl apps > but not wit

Re: [dev] GPL free Linux

2018-11-12 Thread Michael Forney
On 2018-11-12, Markus Wichmann wrote: > On Mon, Nov 12, 2018 at 11:17:49AM +, Alessandro Pistocchi wrote: >> I would use some help to make it work with X ( does it work with >> Wayland? ). There are not many docs I found about it... > > Ah, that old chestnut. As far as I know, the X input driv

Re: [dev] Some questions about sdhcp

2018-10-11 Thread Michael Forney
On 2018-10-11, Markus Wichmann wrote: > Hi all, > > I recently read the source code of sdhcp, and it does seem to be a nice > tool, but I couldn't help but notice a few things. Now, maybe I'm dense, > and none of the things I'm about to bring up matter for some reason, and > if so, that would be r

Re: [dev] [bc]

2018-03-13 Thread Michael Forney
On 2018-03-13, Laslo Hunhold wrote: > On Tue, 13 Mar 2018 13:44:08 -0600 > Gavin Howard wrote: >> About GNU extensions: this was originally implemented for toybox >> (http://landley.net/toybox/), and the maintainer specifically asked >> that my bc be able to run >> https://git.kernel.org/pub/scm/

Re: [dev] securiy guidance

2018-03-08 Thread Michael Forney
On 2018-03-07, pet...@riseup.net wrote: > Looking at the chacha API one needs to use a nonce, in the monocypher > implementation it is 24 bits wide, which would give the option of almost > 17M runs with a single key. IIUC adding a salt would further randomize > the output and possibly prevent some

Re: [dev] securiy guidance

2018-03-08 Thread Michael Forney
On 2018-03-07, pet...@riseup.net wrote: > On 2018-03-07 00:23, Michael Forney wrote: >> Another related project I've been following is https://monocypher.org/ >> >> It has a quite permissive license and encourages inlining the source >> like you want. > > Hi

Re: [dev] securiy guidance

2018-03-06 Thread Michael Forney
On 2018-03-06, pet...@riseup.net wrote: > On 2018-03-06 10:01, Truls Becken wrote: >> Some libraries to look at are; libressl, libtomcrypt, nacl.cr.yp.to, >> libsodium, nettle, libgcrypt and libmcrypt. > > Hello Truls, > > thank you for this list. I was hoping there would be a publicly > available

Re: [dev] Some suckless hackathon 2017 preparation

2017-09-01 Thread Michael Forney
On 2017-09-01, Silvan Jegen wrote: > On Fri, Sep 01, 2017 at 08:40:34AM -0400, Carlos Torres wrote: >> > On Aug 30, 2017, at 2:07 PM, Silvan Jegen wrote: >> > >> > * Wayland dwm prototype? >> > * Suckless Wayland client library prototype? >> >>

Re: [dev] [ANN] samurai: ninja-compatible build tool

2017-07-26 Thread Michael Forney
On 7/26/17, Anselm R Garbe wrote: > On 26 July 2017 at 09:05, Silvan Jegen wrote: >> That's what I suspected. Not sure it's desirable to ever work on a >> codebase big enough to require a build system which uses ninja under >> the hood. If I find myself in such a position I will turn to samurai >

Re: [dev] [ANN] samurai: ninja-compatible build tool

2017-07-25 Thread Michael Forney
On 7/25/17, Silvan Jegen wrote: > Hi > > On Wed, Jul 26, 2017 at 7:32 AM, Michael Forney > wrote: >> Over the past couple weeks, I implemented a ninja-compatible build >> tool in C. It is much simpler and smaller than ninja and seems to >> perform at least as

[dev] [ANN] samurai: ninja-compatible build tool

2017-07-25 Thread Michael Forney
Hi all, Over the past couple weeks, I implemented a ninja-compatible build tool in C. It is much simpler and smaller than ninja and seems to perform at least as well. https://github.com/michaelforney/samurai It has all the features I care about, apart from gcc -MD header dependency parsing which

[dev] git://git.suckless.org not accepting connections

2017-07-03 Thread Michael Forney
Hi, I noticed that git.suckless.org is no longer accepting connections with the git protocol. HTTP still works though. Just pointing that out in case it wasn't a deliberate change. -Michael

Re: [dev] [sbase] Changing BUFSIZ

2017-06-14 Thread Michael Forney
On 6/13/17, Mattias Andrée wrote: > On Linux, the performance of cat(1) can be doubled > when cat(1):ing from one pipe to another, by compiling > with -DBUFSIZ=(1<<16) (the default pipe capacity). > This is close to optimial for a read(3)/write(3) > implementation. Agreed. On my sbase branch, I b

Re: [dev] oasis: small linux system inspired by stali

2017-03-29 Thread Michael Forney
On Tue, Mar 28, 2017 at 3:34 AM, Kamil Cholewiński wrote: >> I think it might have been possible to use some other build tool to >> achieve something similar, but I don't think it would have worked out >> as well. > > http://gittup.org/tup/ ? I think tup could have worked too, but I still prefer

Re: [dev] oasis: small linux system inspired by stali

2017-03-28 Thread Michael Forney
On Mon, Mar 27, 2017 at 2:44 PM, Marc André Tanner wrote: > Hi Michael, > > Overall I like your package selection, but I also have a few questions: > > * Did you consider using netbsd-curses[1] instead of ncurses? > >This probably won't work as is, because libtermkey as required by >vis d

[dev] oasis: small linux system inspired by stali

2017-02-12 Thread Michael Forney
For a while now, I've been working on putting together a linux system based on suckless core tools, as well as various other projects. There are still a number of things left to do, but I'm now at a point where it is quite usable for me, and maybe for others as well. https://github.com/michaelforn

Re: [dev] a

2017-02-02 Thread Michael Forney
On 2/2/17, willy wrote: > At this point, I'm not sure where to look at, or even if the bug > really lies in tar and not in bzip2. > I checked the size (both octal and converted) and the value is good. So > I'm not sure why the headers are not well read. > In the case of the archive above, the erro

Re: [dev] [sbase] [tar] some errors

2016-12-24 Thread Michael Forney
On 12/24/16, Cág wrote: > Markus Wichmann wrote: > >> Well, that looks like it might be problematic, doesn't it? Especially >> when you find out, that the size of h->name there is 100 bytes. path >> contains, of course, the entire file path relative to the starting >> directory. In short, you will

[dev] [sbase] Allow \t escape in sed?

2016-12-06 Thread Michael Forney
I recently came across an issue running `make headers_install` for installing kernel headers. The headers_install.sh script runs sed -r \ -e 's/([ \t(])(__user|__force|__iomem)[ \t]/\1/g' \ -e 's/__attribute_const__([ \t]|$)/\1/g' \ -e 's@^#include @@' \ -e 's/(^|[^a-zA-Z0-9])__packed([^a-

Re: [dev] [stali] Root CA certificates

2016-10-23 Thread Michael Forney
On 10/23/16, Bruno Vetter wrote: >> I suggest just grabbing cert.pem from libressl. > > Thanks for the quick reply. Do you know if there is a designated default > path for certs in stali? It looks like the stali curl_config.h sets CURL_CA_BUNDLE to /etc/ssl/certs/ca-certificates.crt[0]. I suspect

Re: [dev] [stali] Root CA certificates

2016-10-23 Thread Michael Forney
On Sun, Oct 23, 2016 at 8:47 AM, Bruno Vetter wrote: > what is the recommended way to obtain a decent bundle of CA certificates for > stali? Like the ones I find in /etc/ssl/certs in my current distro. I suggest just grabbing cert.pem from libressl.

Re: [dev] [stali] How to view manpages?

2016-10-17 Thread Michael Forney
On Mon, Oct 17, 2016 at 6:53 PM, Evan Gates wrote: > The plan for now is to use 9 base troff and a pager which has not yet > been picked. Currently 9 base troff has been added to the src repo, > but the mdoc macros still need to be included (the ones from heirloom > troff worked). As such you shou

Re: AW: [dev] [stali] Need musl based toolchain on stali installation

2016-10-11 Thread Michael Forney
On Oct 7, 2016 7:24 AM, "Bruno Vetter" wrote: > yes, it's tedious and I understand that it's not crucial to have the > toolchain statically linked. Trying to do so also brings up a lot of > questions that I cannot answer easily. For example a statically linked linker > apparently does not suppo

Re: [dev] sbase installed first impressions

2016-10-03 Thread Michael Forney
On Mon, Oct 3, 2016 at 5:02 PM, stephen Turner wrote: > Thanks for the links i will check it out! Also i wasn't aware of the > -F function, playing with it now and that is a big help with working > around the whole color bit. Clearly the / is for directories. How are > the rest used? Surprisingly

Re: [dev] Wayland vs X11

2016-08-02 Thread Michael Forney
can you compare the two? You need a third-party library (wld) to > > get shit done. Just wait down the line how much of a fucking mess we > > are going to have! With X11 and Xlib, you need an X server that implements every drawing routine you might want to call. But maybe you are arguing for server-side rendering over the display server connection. I think it's simpler to just have the client do the rendering, which it can do however it pleases. -- Michael Forney

[dev] [sbase] [PATCH 1/3] grep: Reverse some if-else logic

2016-05-13 Thread Michael Forney
This way, people don't have to do double negatives in their head. --- grep.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/grep.c b/grep.c index 64ffbe2..ae23967 100644 --- a/grep.c +++ b/grep.c @@ -114,23 +114,23 @@ grep(FILE *fp, const char *str)

[dev] [sbase] [PATCH 3/3] grep: Fix -v output and exit status

2016-05-13 Thread Michael Forney
Previously, it printed lines that didn't match some pattern. Instead, it should print lines that don't match *any* pattern. Test case: out=$(echo foo | ./grep -v -e foo -e bar) if [ "$?" = 1 ] && [ -z "$out" ] ; then echo pass else echo fail fi --- grep.c | 28 +++

[dev] [sbase] [PATCH 2/3] grep: Fix exit status with -F when last line doesn't match

2016-05-13 Thread Michael Forney
Test case: if printf '%s\n' foo bar | ./grep -F foo >/dev/null ; then echo pass else echo fail fi --- grep.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grep.c b/grep.c index ae23967..fb911ff 100644 --- a/grep.c +++ b/grep.c @@ -107,7 +107,7 @@ grep

[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. >

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

2016-03-12 Thread Michael Forney
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 sort -u to never succeed. --- sort.c | 11 --- 1 file changed, 8 i

Re: [dev] Re: Stali RC

2015-10-04 Thread Michael Forney
On Fri, Oct 02, 2015 at 05:25:55PM +0200, Jens Staal wrote: > On Friday 02 October 2015 16.59.57 Christian Neukirchen wrote: > > (Statically linking X11 apps results in massively bloated binaries, > > I can't recommend it.) > > Anyone tried a static wayland dwm-like client like velox and its wayla

[dev] [sbase] [PATCH 3/3] touch: Use both atime and mtime of reference file

2015-05-15 Thread Michael Forney
--- touch.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/touch.c b/touch.c index 2789716..fb04142 100644 --- a/touch.c +++ b/touch.c @@ -14,14 +14,13 @@ static int aflag; static int cflag; static int mflag; -static struct timespec t; +static struct

[dev] [sbase] [PATCH 2/3] touch: Handle nanosecond timestamps

2015-05-15 Thread Michael Forney
--- touch.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/touch.c b/touch.c index 563f919..2789716 100644 --- a/touch.c +++ b/touch.c @@ -14,14 +14,14 @@ static int aflag; static int cflag; static int mflag; -static time_t t; +static struct times

[dev] [sbase] [PATCH 1/3] mv, cp: Preserve nanosecond timestamps

2015-05-15 Thread Michael Forney
Otherwise, we run into problems in a typical autoconf-based build system: - config.status is created at some point between two seconds. - config.status is run, generating Makefile by first writing to a file in /tmp, and then mv-ing it to Makefile. - If this mv happens before the beginnin

[dev] Miscellaneous sbase issues

2015-04-26 Thread Michael Forney
Hi suckless, I came across some issues in sbase whose solution wasn't immediately apparent: printf -- Ignores flag characters '#', '0', '-', ' ', and '+', but is labeled as POSIX compliant and complete, so this is presumably unintentional. "git am" breaks without this functionality. tar ---

[dev] [sdhcp] [PATCH 1/2] Only fork once

2015-04-26 Thread Michael Forney
--- sdhcp.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sdhcp.c b/sdhcp.c index aa3cef2..9ff9baf 100644 --- a/sdhcp.c +++ b/sdhcp.c @@ -339,6 +339,8 @@ acceptlease(void) static void run(void) { + int forked = 0; + #if 0 InitReboot: /* send DHCPre

[dev] [sdhcp] [PATCH 2/2] Add flag to run in foreground

2015-04-26 Thread Michael Forney
--- sdhcp.1 | 3 +++ sdhcp.c | 8 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sdhcp.1 b/sdhcp.1 index ef22689..d037624 100644 --- a/sdhcp.1 +++ b/sdhcp.1 @@ -28,6 +28,9 @@ don't change interface information such as an IP address. .TP .B "\-e program" run program. Var

[dev] [sbase] [PATCH] tr: Fix -c option when translating

2015-04-26 Thread Michael Forney
--- tr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tr.c b/tr.c index 38ea6a3..ad5c690 100644 --- a/tr.c +++ b/tr.c @@ -221,6 +221,8 @@ read: else goto write; } + if (cf

Re: [dev] [sbase] [PATCH v2] rm: Fix exit status with -f for nonexistent paths

2015-03-01 Thread Michael Forney
On Sun, Mar 01, 2015 at 11:51:35PM +0100, FRIGN wrote: > On Sun, 1 Mar 2015 14:44:12 -0800 > Michael Forney wrote: > > That looks good to me. > > Thanks! Applied: > http://git.2f30.org/sbase/commit/?id=48696d8c955db9d0621812aca7ef5caac727da31 I just realized that this coul

Re: [dev] [sbase] [PATCH v2] rm: Fix exit status with -f for nonexistent paths

2015-03-01 Thread Michael Forney
On Sun, Mar 01, 2015 at 11:23:28PM +0100, FRIGN wrote: > I'd do it like this instead, makes it clearer that we're > dealing with one special case: > > if (remove(path) < 0) { > if (!rm_fflag) > weprintf("remove %s:", path); > rm_status = !(rm

[dev] [sbase] [PATCH v2] rm: Fix exit status with -f for nonexistent paths

2015-03-01 Thread Michael Forney
Under the description for the -f option, POSIX says, "Do not modify the exit status in the case of nonexistent operands". --- Whoops, just realized that simply using the errno from the remove call is way simpler. libutil/rm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

[dev] [sbase] [PATCH] rm: Fix exit status with -f for nonexistent paths

2015-03-01 Thread Michael Forney
Under the description for the -f option, POSIX says, "Do not modify the exit status in the case of nonexistent operands". --- libutil/rm.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libutil/rm.c b/libutil/rm.c index 53ae3f2..30a1b41 100644 --- a/libutil/rm.c +++ b/li

Re: [dev] [sbase] [PATCH v3] ls: Handle symlinks to directories properly

2014-12-08 Thread Michael Forney
On Mon, Dec 08, 2014 at 04:21:30PM -0800, Eric Pruitt wrote: > Unless I'm missing something, I still don't see anything in that patch > pertaining to the interpretation of slashes. I'm not sure what you're expecting... When you lstat "foo/", where foo is a symlink to a directory, you look up info

[dev] [sbase] [PATCH] cp: Rename -d option to -P

2014-12-07 Thread Michael Forney
The -d option is a GNU extension and is equivalent to its "-P --preserve=links" options. Since we don't implement the --preserve=links functionality anyway (it means preserve hard links between files), just call it -P, which is specified by POSIX. Additionally, there is no need to check for cp_Pf

[dev] [sbase] [PATCH] ls: Always leave room for the NULL byte in the link target

2014-12-07 Thread Michael Forney
Otherwise, if the length of the link target is the same as BUFSIZ, we will try to write past the end of buf. --- ls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ls.c b/ls.c index b48391b..a2fb5cb 100644 --- a/ls.c +++ b/ls.c @@ -291,7 +291,7 @@ output(Entry *ent)

[dev] [sbase] [PATCH v3] ls: Handle symlinks to directories properly

2014-12-07 Thread Michael Forney
Also, implement the -H and -L options. --- Again, not sure how to handle the long line. ls.1 | 9 - ls.c | 32 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/ls.1 b/ls.1 index ec61bee..792b07b 100644 --- a/ls.1 +++ b/ls.1 @@ -3,7 +3,7 @@

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

2014-12-07 Thread Michael Forney
On Sun, Dec 07, 2014 at 03:43:36PM -0800, Eric Pruitt wrote: > I don't know if this is the correct behavior. Whether or not a symlink > to a directory has its contents shown with GNU ls depends on whether or > not there's a slash present and the flags used: > > playground$ mkdir AFolder >

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

2014-12-07 Thread Michael Forney
--- Not sure if you want to break up the long line. Up to you. Another possibility is if (S_ISLINK(ent->mode)) stat(path, &st); ent->isdir = S_ISDIR(st.st_mode); which looks nicer, but I'm not sure if stat(2) is required to not modify the st argument if it fails.

[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 { >

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

2014-12-07 Thread Michael Forney
--- 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 mtime; ino_t ino; + int isdir; } Entry; static int entcmp(const vo

[dev] [sbase] [PATCH] ln: Add support for target directories

2014-11-23 Thread Michael Forney
Also, now that we are using {sym,}linkat, implement the trivial -L and -P options. --- ln.1 | 11 +-- ln.c | 53 ++--- 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/ln.1 b/ln.1 index 4205ea7..3b1ac98 100644 --- a/ln.1 +++ b

[dev] [sbase] [PATCH] sort: Implement -c and -C flags

2014-11-23 Thread Michael Forney
--- sort.1 | 11 +++ sort.c | 57 +++-- 2 files changed, 58 insertions(+), 10 deletions(-) diff --git a/sort.1 b/sort.1 index 12fb95d..71c8154 100644 --- a/sort.1 +++ b/sort.1 @@ -15,9 +15,20 @@ writes the sorted concatenation of the giv

[dev] [sbase] [PATCH 2/2] chown: Support numeric uids/gids

2014-11-02 Thread Michael Forney
--- chown.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/chown.c b/chown.c index 3fd5f87..5d57801 100644 --- a/chown.c +++ b/chown.c @@ -11,8 +11,8 @@ static void chownpwgr(const char *); static bool rflag = false; -static struct passwd *pw = N

[dev] [sbase] [PATCH 1/2] Fix symbolic mode parsing in parsemode

2014-11-02 Thread Michael Forney
I found quite a lot of bugs, so I ended up pretty much rewriting as I followed the spec¹. Now, it works as follows: - Determine a mask (who) of bits that can be modified for the subsequent operations. If none are specified, select all file mode bits. - In a loop, determine which operation (+, -

[dev] [sbase] [PATCH 2/2] grep: Fix -c flag

2014-11-01 Thread Michael Forney
--- grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grep.c b/grep.c index 1376513..489f6e7 100644 --- a/grep.c +++ b/grep.c @@ -42,11 +42,11 @@ main(int argc, char *argv[]) case 'E': flags |= REG_EXTENDED; break; - case 'c':

[dev] [sbase] [PATCH 1/2] grep: Remove newlines before matching a line

2014-11-01 Thread Michael Forney
Otherwise, a pattern with a '$' anchor will never match and POSIX says that "By default, an input line shall be selected if any pattern ... matches any part of the line excluding the terminating " --- grep.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/grep.c b/

Re: [dev] [sbase] [PATCH 1/4] tar: Don't crash when get{pw,gr}uid fails

2014-11-01 Thread Michael Forney
On Sat, Nov 01, 2014 at 08:57:12PM +, Dimitris Papastamos wrote: > On Sat, Nov 01, 2014 at 08:36:37PM +0000, Michael Forney wrote: > > - snprintf(h->uname, sizeof h->uname, "%s", pw->pw_name); > > - snprintf(h->gname, sizeof h->gname, "%s",

[dev] [sbase] [PATCH 1/4] tar: Don't crash when get{pw,gr}uid fails

2014-11-01 Thread Michael Forney
--- tar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tar.c b/tar.c index 4f4abff..c18d89e 100644 --- a/tar.c +++ b/tar.c @@ -177,8 +177,8 @@ archive(const char* path) putoctal(h->mtime, (unsigned)st.st_mtime, sizeof h->mtime); memcpy(h->magic, "us

[dev] [sbase] [PATCH 4/4] tar: Handle archives with the prefix field

2014-11-01 Thread Michael Forney
Also, handle names and prefixes that fill the entire field (and have no NUL byte) by using a precision specifier. --- tar.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tar.c b/tar.c index 47d2334..7588a41 100644 --- a/tar.c +++ b/tar.c @@ -29,6 +29,7 @@ struct Heade

[dev] [sbase] [PATCH 3/4] tar: Implement -m flag

2014-11-01 Thread Michael Forney
This changes the default behavior to adjust mtimes to what is present in the file header. --- tar.c | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tar.c b/tar.c index 7bd709d..47d2334 100644 --- a/tar.c +++ b/tar.c @@ -2,9 +2,11 @@ #include #inclu

[dev] [sbase] [PATCH 2/4] tar: Support typeflag '\0' when extracting

2014-11-01 Thread Michael Forney
POSIX recommends that "For backwards-compatibility, a typeflag value of binary zero ( '\0' ) should be recognized as meaning a regular file when extracting files from the archive". --- tar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tar.c b/tar.c index c18d89e..7bd709d

Re: [dev] [st] will global-less changes be wanted upstream?

2014-08-17 Thread Michael Forney
On Sat, Aug 16, 2014 at 06:32:01PM -0500, Steven Degutis wrote: > > What is the point? > > One obvious cons is that it will bloat the code, make it less readable. > > First of all, I would not agree that it would bloat the code or make > it less readable. In fact I think it will increase readabili

[dev] [st] [PATCH] Fix disabling of bold and fastblink

2014-07-26 Thread Michael Forney
According to ECMA-48¹ 8.3.117, an attribute value of 21 is "doubly underlined", while 22 is "normal colour or normal intensity (neither bold nor faint)". Additionally, 25 is "steady (not blinking)", which likely means neither slow blink nor fast blink. ¹: http://www.ecma-international.org/publica

Re: [dev] swc: A small Wayland compositor

2014-01-29 Thread Michael Forney
o opening and revoking devices) and for now I will probably leave it as-is. As swc matures, we could revisit this if it does present any problems. -- Michael Forney

Re: [dev] swc: A small Wayland compositor

2014-01-25 Thread Michael Forney
uot; to debug crashes. However, I do see the potential risk. Another solution could be having a configuration file in /etc containing a list of allowed display servers. Thoughts? -- Michael Forney

[dev] swc: A small Wayland compositor

2014-01-23 Thread Michael Forney
ctyla. [0]: https://github.com/michaelforney/wld [1]: https://github.com/michaelforney/swc/blob/master/libswc/swc.h -- Michael Forney

Re: swc library to implement dwm under Wayland (was Re: [dev] gtk3 support for surf?)

2014-01-14 Thread Michael Forney
s very useful and well optimized (from what I can tell). Text rendering was a bit tough to get working because you have to do glyph arrangement and rendering yourself (probably using FreeType). -- Michael Forney

Re: swc library to implement dwm under Wayland (was Re: [dev] gtk3 support for surf?)

2014-01-14 Thread Michael Forney
s all about making > a decision. I don't think it is so important to make a decision as much as to be aware of all the possibilities. Also, while I'm happy that swc is getting attention, it is perhaps happening just a little too early; don't expect to be able to try it out right now, I have a lot of changes pending in my working tree which I hope to get committed over the next few days. Additionally, there are a couple of final things I need to finish up (mainly VT switching). -- Michael Forney

Re: [dev] gtk3 support for surf?

2014-01-10 Thread Michael Forney
ager should be separate projects, which is why I implemented swc as a library. Look at the number of tiling X11 window managers out there. It doesn't make sense to have each of them implement their own compositing code. Please let me know if you have any questions! I would be happy to help! -- Michael Forney

Re: [dev] [st] [PATCH] Fix some bugs in mouse tracking logic

2013-09-13 Thread Michael Forney
); > } else { > line[count++] = CharOf(0xC0 + (value >> 6)); > line[count++] = CharOf(0x80 + (value & 0x3F)); > } > break; > } > return count; > } As you can see, value begins as ' ' (== 32) + the button value (BtnCode also adds 32), and then 32 is subtracted only when in SGR mode. -- Michael Forney

Re: [dev] Wayland st!!??

2013-07-29 Thread Michael Forney
scares me and I wasn't thrilled with it overall. > Implementing a proxy wl_shell for this hypothetical blitting compositor > and having dwm as a separate process communicating with it would be > another possible approach. Yeah, that's what I tried to describe. -- Michael Forney

Re: [dev] Wayland st!!??

2013-07-29 Thread Michael Forney
ve a single program which does quite a lot of stuff. I'd love to hear other people's opinions on this topic. -- Michael Forney

Re: [dev] Wayland st!!??

2013-07-27 Thread Michael Forney
there to be a suckless Wayland environment for a while, and maybe something better will come around before there is, but I think my rendering library could be useful in either case (the Wayland part is just buffer creation/management and is separate from the rendering part). -- Michael Forney

[dev] [st] [PATCH] Fix blink mode check

2013-07-25 Thread Michael Forney
ATTR_BLINK is an attribute for a Glyph and will not be set in term.mode. --- Again, I haven't actually run into any problems caused by this, but this seems like a typo to me. st.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/st.c b/st.c index 8992998..734c345 100644 ---

  1   2   >