[hackers] ed: Enable multi line commands

2023-12-13 Thread Roberto E. Vargas Caballero
It changes to read full lines before executing commands, escaping newlines when it is needed. It solves 2 different cases: - Substitution commands with newlines in the replace part - Global commands with append or insert commands Still, some additional problems were detected in th

[hackers] [PATCH 1/6] ed: Add optional parameter to string()

2023-12-13 Thread Roberto E. Vargas Caballero
This makes possible to use the function to initialize the string from an existing char array. --- ed.c | 30 +- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/ed.c b/ed.c index b430e74..13e956a 100644 --- a/ed.c +++ b/ed.c @@ -122,12 +122,24 @@ prevln(in

[hackers] [PATCH 2/6] ed: Add getinput() and setinput()

2023-12-13 Thread Roberto E. Vargas Caballero
These functions allow to read from stdin the full next line or seting as input a character array. These functions avoid all the complexity about repeat commands that is very fragile and depends on having multiple global variables with weak relation between them. --- ed.c | 171

[hackers] [PATCH 3/6] ed: Read from input in append()

2023-12-13 Thread Roberto E. Vargas Caballero
This enables using a and i commands in a global command because the input is not anymore taken from stdin. --- ed.c | 30 ++ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/ed.c b/ed.c index 7881fba..ad6c81a 100644 --- a/ed.c +++ b/ed.c @@ -686,6 +686,15

[hackers] [PATCH 4/6] ed: Avoid dangling pointer in getrhs()

2023-12-13 Thread Roberto E. Vargas Caballero
If the string r.str is freed but error() is called then next call will see a pointer that maybe it will try to free because the call to error unwind the frame stack. --- ed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ed.c b/ed.c index ad6c81a..16fbe04 100644 --- a/ed.c ++

[hackers] [PATCH 5/6] ed: Improve execsh

2023-12-13 Thread Roberto E. Vargas Caballero
--- ed.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ed.c b/ed.c index 16fbe04..60673a2 100644 --- a/ed.c +++ b/ed.c @@ -1061,13 +1061,21 @@ execsh(void) } while ((c = input()) != '\0') { - if (c == '%' && (cmd.siz == 0 || cmd.s

[hackers] [PATCH 6/6] ed: Update TODO

2023-12-13 Thread Roberto E. Vargas Caballero
Remove the cases are tested to work correctly now. --- TODO | 16 1 file changed, 16 deletions(-) diff --git a/TODO b/TODO index a78cf8b..000fd06 100644 --- a/TODO +++ b/TODO @@ -28,10 +28,6 @@ Bugs ed -- -* Multi-line commands don't work in global commands: -g/^line/a \

Re: [hackers] [svkbd][PATCH] this patch fixes uppercase in armenian (and perhaps some other) layouts. svkbd was previously registering a key in one modification (xorg accepts up to 4 modifications). w

2023-12-13 Thread նորայր
ok let me try to explain this very simply. some time ago i have added armenian and dvorak layouts. i have noticed that in dvorak and all other layouts uppercase characters work. while you don't have to do any extra effort for that. let's say: ``` { 0, 0, XK_a, 1 }, { 0, 0, XK_o, 1

Re: [hackers] [svkbd][PATCH] this patch fixes uppercase in armenian (and perhaps some other) layouts. svkbd was previously registering a key in one modification (xorg accepts up to 4 modifications). w

2023-12-13 Thread նորայր
also no need to know armenian to test. just run ./svkbd-mobile-intl and type lowercase and uppercase in armenian layout. do that for the patched version and you'll see the difference. for some reason on sxmo/postmarketos i have to restart the device in order to run a newer binary. though i thin

[hackers] [svkbd] fix uppercase in armenian (and perhaps some other) layouts || norayr chilingarian

2023-12-13 Thread git
commit 92795b2a0ac2f9c2a26bcdf8752e8f0ab7c11675 Author: norayr chilingarian AuthorDate: Sun Dec 3 20:22:04 2023 +0400 Commit: Hiltjo Posthuma CommitDate: Wed Dec 13 19:10:08 2023 +0100 fix uppercase in armenian (and perhaps some other) layouts "This patch fixes uppercase in

Re: [hackers] [svkbd][PATCH] this patch fixes uppercase in armenian (and perhaps some other) layouts. svkbd was previously registering a key in one modification (xorg accepts up to 4 modifications). w

2023-12-13 Thread Hiltjo Posthuma
Hi, Thanks, I've applied the patch and fixed a tiny typo in the debug message. I haven't tested the patch, but I trust you that it works. Of course if people notice bugs, feel free to report them. On Wed, Dec 13, 2023 at 04:30:17PM +0400, նորայր wrote: > also no need to know armenian to test. >