Re: [dev] [st] [PATCH] Optimize memory footprint of line buffers

2015-04-27 Thread Roberto E. Vargas Caballero
I have applied a version of this patch with short size. typedef struct { char c[UTF_SIZ]; /* character code */ - ushort mode; /* attribute flags */ - uint32_t fg; /* foreground */ - uint32_t bg; /* background */ + ushort mode; /* attribute flags

Re: [dev] [st] [PATCH] Fix sigchld

2015-04-27 Thread Roberto E. Vargas Caballero
Hi, Only wait for termination of the shell. ... - if(waitpid(pid, stat, 0) 0) + if((p = waitpid(pid, stat, WNOHANG)) 0) die(Waiting for pid %hd failed: %s\n, pid, strerror(errno)); I don't understand this patch. The master process only has one child, the shell, so

Re: [dev] books that rock

2015-04-27 Thread Jakukyo Friel
On Sun, Apr 26, 2015 at 10:35 AM, Wolfgang Corcoran-Mathe first.lord.of.t...@gmail.com wrote: Quoth Lee Fallat on Sat, Apr 25 2015 21:57 -0400: The UNIX Hater's Handbook. A great perspective on UNIX. In what way? I remember a chapter-length rant about rm(1) being broken because it actually

Re: [dev] [st PATCH 1/3] xloadcols: remove cp variable

2015-04-27 Thread Roberto E. Vargas Caballero
With the pointer loop, you need to understand the context of the surrounding for loop to understand what this statement is executing. I can’t tell anything from just this one line of code other than that a method is being called with what appear to be a pointer (based on the assumption that

Re: [dev] [st] [PATCH] Fix sigchld

2015-04-27 Thread Jochen Sprickerhof
Hi Roberto, * Roberto E. Vargas Caballero k...@shike2.com [2015-04-27 10:42]: I don't understand this patch. The master process only has one child, the shell, so you only can wait for it. If you receives the signal is because the child already died, so I don't see the point of adding WNOHANG.

Re: [dev] [st] [PATCH] Fix sigchld

2015-04-27 Thread koneu
On April 27, 2015 11:31:22 AM CEST, Jochen Sprickerhof d...@jochen.sprickerhof.de wrote: * koneu kone...@googlemail.com [2015-04-27 11:25]: On April 27, 2015 11:23:52 AM CEST, Jochen Sprickerhof d...@jochen.sprickerhof.de wrote: I'm spawning other process from st (dmenu and surf for urlview).

Re: [dev] [st] [PATCH] Fix sigchld

2015-04-27 Thread Jochen Sprickerhof
* koneu kone...@googlemail.com [2015-04-27 11:25]: On April 27, 2015 11:23:52 AM CEST, Jochen Sprickerhof d...@jochen.sprickerhof.de wrote: I'm spawning other process from st (dmenu and surf for urlview). Without checking the pid, st stops working if some other child finishes. Without

Re: [dev] [st] [PATCH] Fix sigchld

2015-04-27 Thread koneu
On April 27, 2015 11:23:52 AM CEST, Jochen Sprickerhof d...@jochen.sprickerhof.de wrote: Hi Roberto, * Roberto E. Vargas Caballero k...@shike2.com [2015-04-27 10:42]: I don't understand this patch. The master process only has one child, the shell, so you only can wait for it. If you receives

Re: [dev] Miscellaneous sbase issues

2015-04-27 Thread Dimitris Papastamos
On Sun, Apr 26, 2015 at 06:24:18PM -0700, Michael Forney wrote: tar --- Since fb1595a69c091a6f6a9303b1fab19360b876d114, tar calls remove(3) on directories before extracting them. I'm not sure that it is reasonable for tar to do this because users may want to re-extract archives, or extract

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

2015-04-27 Thread Hiltjo Posthuma
On Mon, Apr 27, 2015 at 3:00 AM, Michael Forney mfor...@mforney.org wrote: --- Thanks for contributing! I have applied both patches and added you to the LICENSE file. Kind regards, Hiltjo

Re: [dev] [st utf8 3/4] Change internal character representation.

2015-04-27 Thread Roberto E. Vargas Caballero
Applied (with minor changes), thanks.

Re: [dev] [st utf8 3/4] Change internal character representation.

2015-04-27 Thread koneu
On April 27, 2015 9:58:37 AM CEST, Roberto E. Vargas Caballero k...@shike2.com wrote: GCC and Clang define long as 64-bits by default for x86_64, AArch64, and many other 64-bit target architectures, which is wasteful for Unicode code points. Uhmmm, so do you propose don't use long arrays

Re: [dev] [st] [PATCH] Clarify calculation precedence for '' and '?'

2015-04-27 Thread Roberto E. Vargas Caballero
Applied, thanks.

Re: [dev] [st] [PATCH] Use %u for uint

2015-04-27 Thread Roberto E. Vargas Caballero
Applied, thanks.

Re: [dev] [st utf8 1/4] Use utf8len instead of utf8decode.

2015-04-27 Thread Roberto E. Vargas Caballero
Applied, thanks. ---BeginMessage--- --- st.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/st.c b/st.c index 0204b2e..b756a40 100644 --- a/st.c +++ b/st.c @@ -3672,7 +3672,6 @@ drawregion(int x1, int y1, int x2, int y2) { Glyph base, new; char

Re: [dev] [st utf8 4/4] Make tputc, tsetchar and techo accept unicode

2015-04-27 Thread Roberto E. Vargas Caballero
Applied, thanks.

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

2015-04-27 Thread Markus Teich
Michael Forney wrote: + if(!forked) { + if(fork()) + exit(EXIT_SUCCESS); + forked = 1; + } Heyho, why not: if(!forked fork()) exit(EXIT_SUCCESS); forked = 1; You could also use if(!forked

Re: [dev] [st] [PATCH] len assignment is never used

2015-04-27 Thread Roberto E. Vargas Caballero
Applied, thanks.

Re: [dev] [st] [PATCH] Optimize memory footprint of line buffers

2015-04-27 Thread koneu
On April 27, 2015 10:29:25 AM CEST, Roberto E. Vargas Caballero k...@shike2.com wrote: typedef struct { uint_least32_t u; uint_least32_t mode:12; uint_least32_t fg:10; uint_least32_t bg:10; } Glyph; The size of this struct is only one byte less than if the same of the

Re: [dev] [st utf8 3/4] Change internal character representation.

2015-04-27 Thread Silvan Jegen
On Mon, Apr 27, 2015 at 10:05 AM, koneu kone...@googlemail.com wrote: On April 27, 2015 9:58:37 AM CEST, Roberto E. Vargas Caballero k...@shike2.com wrote: GCC and Clang define long as 64-bits by default for x86_64, AArch64, and many other 64-bit target architectures, which is wasteful for

Re: [dev] books that rock

2015-04-27 Thread Jakukyo Friel
On Sat, Apr 25, 2015 at 4:25 PM, Roberto E. Vargas Caballero k...@shike2.com wrote: - KR - The practice of programming - The dragon book - The standard C library. P.J. Plauger - Lions book - The desing of the unix operating system. J. Bach - The art of unix programming - Let's build a

Re: [dev] [st] [PATCH] Fix sigchld

2015-04-27 Thread Roberto E. Vargas Caballero
Hi, Only wait for termination of the shell. ... - if(waitpid(pid, stat, 0) 0) + if((p = waitpid(pid, stat, WNOHANG)) 0) die(Waiting for pid %hd failed: %s\n, pid, strerror(errno)); I don't understand this patch. The master process only has one child, the shell, so

Re: [dev] [st utf8 3/4] Change internal character representation.

2015-04-27 Thread Roberto E. Vargas Caballero
GCC and Clang define long as 64-bits by default for x86_64, AArch64, and many other 64-bit target architectures, which is wasteful for Unicode code points. Uhmmm, so do you propose don't use long arrays ever? because in some implementations long may be 4, but in others may be 8. We also

Re: [dev] [st] [PATCH] Replace close and dup with dup2.

2015-04-27 Thread Roberto E. Vargas Caballero
Hi, Matter of style maybe. It's still annoying to have noise in the build. I don't admit this types of commits about quiting some compiler. First point, warnings are not part of the standard, so you are free of take care of them or not. If you don't like to have noise add some flags to your

Re: [dev] Miscellaneous sbase issues

2015-04-27 Thread koneu
On April 27, 2015 3:24:18 AM CEST, Michael Forney mfor...@mforney.org wrote: 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

Re: [dev] [st] [PATCH] Optimize memory footprint of line buffers

2015-04-27 Thread Roberto E. Vargas Caballero
typedef struct { uint_least32_t u; uint_least32_t mode:12; uint_least32_t fg:10; uint_least32_t bg:10; } Glyph; The size of this struct is only one byte less than if the same of the struct using shorts. You can test it if you want. Regards,

Re: [dev] Miscellaneous sbase issues

2015-04-27 Thread Nick
Quoth Dimitris Papastamos: Some things that need to be done for tar: ... - Strip leading / from filenames and dangerous things like ../../ etc. OK, attached is a patch that does that. I think it covers all the bases. From b5acf1e9254080c2f283c623f59e412cdb29939a Mon Sep 17 00:00:00 2001

Re: [dev] surf -- how to manage SSL certificates?

2015-04-27 Thread Jakukyo Friel
On Wed, Mar 25, 2015 at 12:16 AM, Nick suckless-...@njw.me.uk wrote: Hi Jakukyo, Quoth Jakukyo Friel: How to manage SSL certificates in surf? If you're just talking about choosing which CAs to accept, surf uses the ca-certificates bundle your distro provides Hmm, 0.4.1 does not support

Re: [dev] [st] [PATCH] Optimize memory footprint of line buffers

2015-04-27 Thread suigin
On Mon, Apr 27, 2015 at 10:09:20AM +0200, Roberto E. Vargas Caballero wrote: I have applied a version of this patch with short size. Okay, thanks! Please, be careful with your commits, because this patch and the other you sent have a lot of white spaces changes that are not needed. Okay, I

Re: [dev] [st PATCH 1/3] xloadcols: remove cp variable

2015-04-27 Thread Garrick Peterson
On Apr 27, 2015, at 2:21 AM, Roberto E. Vargas Caballero k...@shike2.com wrote: Again, read [1], section The use of pointers. Maybe you don't agree with it, but almost all the people here agree with it. Your link shows the use of `node[i].left` as a perfectly valid example when an

Re: [dev] [surf] Patch to print ssl error reasons to stderr

2015-04-27 Thread Nick
I had forgotten about this patch, but it is a useful one and I reckon it should be applied (or rebuked, if appropriate). It still applies fine against the current tip (with fuzz). Quoth Nick: Quoth Markus Teich: I recently wrote a patch that printed useful debug info about SSL

Re: [dev] surf -- how to manage SSL certificates?

2015-04-27 Thread Nick
Quoth Jakukyo Friel: Just tried with the latest commit (b4ca032), surf does not warn about invalid SSL certs. It totally does. Visit https://njw.me.uk and see the U in the SSL section of the status bar, and compare to the T for https://njw.name. Change `static char *strictssl` to true and

Re: [dev] [st] [PATCH] Optimize memory footprint of line buffers

2015-04-27 Thread suigin
On Mon, Apr 27, 2015 at 10:31:38AM +0200, koneu wrote: Add to that, non-int bit fields are a GNU extension. You're right. It works because uint_least32_t happens to be a typedef of unsigned int for x86_64. Changing it so that it reads: typedef struct { uint_least32_t u; unsigned

Re: [dev] [st utf8 3/4] Change internal character representation.

2015-04-27 Thread suigin
On Mon, Apr 27, 2015 at 09:58:37AM +0200, Roberto E. Vargas Caballero wrote: Uhmmm, so do you propose don't use long arrays ever? because in some implementations long may be 4, but in others may be 8. We also should forbid int arrays for the same reason. I would say it depends on the context.

Re: [dev] [st] [PATCH] Optimize memory footprint of line buffers

2015-04-27 Thread suigin
On Mon, Apr 27, 2015 at 10:29:25AM +0200, Roberto E. Vargas Caballero wrote: typedef struct { uint_least32_t u; uint_least32_t mode:12; uint_least32_t fg:10; uint_least32_t bg:10; } Glyph; The size of this struct is only one byte less than if the same of the struct

Re: [dev] [st] [PATCH] Fix sigchld

2015-04-27 Thread koneu
Jochen Sprickerhof wrote: * koneu kone...@googlemail.com [2015-04-27 11:42]: waitpid and WNOHANG is not the way to go though. Use wait Why? wait is just convenience for waitpid. Also, it didn't work for me. Can you send a patch if you think there is a better way to do it? and check the

Re: [dev] [st] [PATCH] Optimize memory footprint of line buffers

2015-04-27 Thread suigin
On Mon, Apr 27, 2015 at 07:34:01AM -0700, suigin wrote: As you can see, it's actually 2 bytes less. This is because a struct is usually aligned to the maximum alignment of all fields. A 16-bit ushort has a 2-byte alignment on x86_64, so this forces the struct to also have an alignment of

Re: [dev] [st] [PATCH] Optimize memory footprint of line buffers

2015-04-27 Thread Alex Pilon
On Mon, Apr 27, 2015 at 06:56:59AM -0700, suigin wrote: What's the general process and ettiquete for submitting patches, do we submit them to solely to this mailing list, or should they also be pushed via git for review? Non-maintainers like us can't push to the repository. Mailing list only.

Re: [dev] [st] [PATCH] Replace close and dup with dup2.

2015-04-27 Thread Alex Pilon
On Mon, Apr 27, 2015 at 10:55:48AM +0200, Roberto E. Vargas Caballero wrote: Matter of style maybe. It's still annoying to have noise in the build. I don't admit this types of commits about quiting some compiler. Ideally, that's fine, and I'd very much agree with you. However, practically,

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

2015-04-27 Thread Dimitris Papastamos
Applied, thanks!

Re: [dev] [st] [PATCH] Fix sigchld

2015-04-27 Thread Jochen Sprickerhof
* koneu kone...@googlemail.com [2015-04-27 11:42]: waitpid and WNOHANG is not the way to go though. Use wait Why? wait is just convenience for waitpid. Also, it didn't work for me. Can you send a patch if you think there is a better way to do it? and check the pid against the shell's to decide

Re: [dev] Miscellaneous sbase issues

2015-04-27 Thread FRIGN
On Sun, 26 Apr 2015 18:24:18 -0700 Michael Forney mfor...@mforney.org wrote: Hi Michael, 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. I

Re: [dev] Miscellaneous sbase issues

2015-04-27 Thread Nick
Quoth Nick: Quoth Dimitris Papastamos: Some things that need to be done for tar: ... - Strip leading / from filenames and dangerous things like ../../ etc. OK, attached is a patch that does that. I think it covers all the bases. One thing the patch doesn't cover is an archive