Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
url = git://git.suckless.org/quark
[submodule "pkg/rc/src"]
path = pkg/rc/src
url = https://github.com/benavento/rc.git
url = git://shithub.us/cinap_lenrek/rc
ignore = all
[submodule "pkg/samurai/src"]
path = pkg/samurai/src
Expand Down
32 changes: 12 additions & 20 deletions pkg/rc/gen.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
cflags{
'-Wpedantic',
'-I $srcdir',
'-I $outdir',
([['-D PREFIX="%s"']]):format(config.prefix),
}

exe('rc', {
'code.c',
'exec.c',
'getflags.c',
'glob.c',
'here.c',
'io.c',
'lex.c',
'pcmd.c',
'pfnc.c',
'simple.c',
'subr.c',
'trap.c',
'tree.c',
'var.c',
'y.tab.c',
'unix.c',
'havefork.c',
'prompt-null.c',
})
yacc('y', 'syn.y')

exe('rc', [[
code.c exec.c getflags.c glob.c
here.c io.c lex.c pcmd.c pfnc.c
simple.c subr.c trap.c tree.c
var.c unix.c havefork.c

$outdir/y.tab.c
]])
file('bin/rc', '755', '$outdir/rc')
man{'rc.1'}

Expand Down
242 changes: 0 additions & 242 deletions pkg/rc/patch/0001-Avoid-multiple-definitions-of-global-variables.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 56359f53946306347ef9bb1f8f3c402adb8f8a5b Mon Sep 17 00:00:00 2001
From 40656566e36b0eb4b557a522c9c309bd5d845cec Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Mon, 4 Nov 2019 20:59:30 -0800
Subject: [PATCH] Use /proc/self/fd/0 instead of /dev/fd/0
Expand All @@ -8,11 +8,11 @@ Subject: [PATCH] Use /proc/self/fd/0 instead of /dev/fd/0
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rcmain.unix b/rcmain.unix
index 42b3be4..1b5d6d2 100644
index 7ccbe1b..2aa9ddb 100644
--- a/rcmain.unix
+++ b/rcmain.unix
@@ -25,9 +25,9 @@ if not if(flag i){
if(flag l && test -r $profile) . $profile
@@ -29,9 +29,9 @@ if not if(flag i){
}
status=''
if(! ~ $#* 0) . $*
- . -i /dev/fd/0
Expand All @@ -24,5 +24,5 @@ index 42b3be4..1b5d6d2 100644
status=''
. $*
--
2.24.0
2.45.2

38 changes: 38 additions & 0 deletions pkg/rc/patch/0002-rc-use-IOUNIT-for-io-NBUF.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 0a6a205f8cd48665527fbe4534e32b04e03ca660 Mon Sep 17 00:00:00 2001
From: kemal <kemalinanc8@gmail.com>
Date: Sat, 23 Sep 2023 23:52:39 +0000
Subject: [PATCH] rc: use IOUNIT for io NBUF

---
io.c | 2 +-
rc.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/io.c b/io.c
index 7c1a27e..be8f647 100644
--- a/io.c
+++ b/io.c
@@ -4,7 +4,7 @@
#include "fns.h"

enum {
- NBUF = 8192,
+ NBUF = IOUNIT,
};

void
diff --git a/rc.h b/rc.h
index a688663..3663a1c 100644
--- a/rc.h
+++ b/rc.h
@@ -19,6 +19,7 @@
#ifndef NSIG
#define NSIG 32
#endif
+#define IOUNIT 32768
#endif

#define YYMAXDEPTH 500
--
2.45.2

25 changes: 25 additions & 0 deletions pkg/rc/patch/0003-rc-handle-Xeflag-in-exitnext.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 8cce15805da628c41a09c2fe3dbbf86c061a5ad1 Mon Sep 17 00:00:00 2001
From: cinap_lenrek <cinap_lenrek@felloff.net>
Date: Wed, 27 Dec 2023 23:07:06 +0000
Subject: [PATCH] rc: handle Xeflag in exitnext()

---
simple.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/simple.c b/simple.c
index 6f4d38b..5f325ba 100644
--- a/simple.c
+++ b/simple.c
@@ -18,7 +18,7 @@ exitnext(void){
loop:
c=&p->code[p->pc];
while(1){
- if(c->f==Xpopredir || c->f==Xunlocal)
+ if(c->f==Xpopredir || c->f==Xunlocal || c->f==Xeflag)
c++;
else if(c->f==Xsrcline)
c += 2;
--
2.45.2

Loading