~lattis

Recent activity

[PATCH] ensure argv passed to getopt is NULL terminated 9 months ago

From Stone Tickle to ~emersion/mrsh-dev

This has two fixes, 1: in push_frame allocates an extra array
element, and uses calloc instead of malloc to ensure that element is
NULL.  2: in argv_dup, enough memory is allocated but, the last element
is left uninitialized.  By using calloc instead, the last element is
guaranteed to be NULL.

I also added a test for this, although it does not always fail since it
relies on undefined behavior.
---
 builtin/set.c    | 2 +-
 shell/shell.c    | 2 +-
 test/args.sh     | 6 ++++++
 test/meson.build | 1 +
 4 files changed, 9 insertions(+), 2 deletions(-)
[message trimmed]

Invalid read in mrsh_getopt getopt.c:13 9 months ago

From Stone Tickle to ~emersion/mrsh-dev

Hi, I sent some messages about this on ##emersion, but I wanted to
reiterate here, since it looks like that channel is not very active.

While working on the read patch, I happened to run mrsh on my macbook
and noticed a bug.  Specifically, if I have a script like this:

#!/bin/mrsh
while getopts "a" opt; do
  do_something
done

And run it like this:

$ ./script.sh -a

[PATCH] make read return 1 when an EOF is encountered 9 months ago

From Stone Tickle to ~emersion/mrsh-dev

For instance:
echo "hi" | read arg
should have an exit code of >0 per the POSIX spec

- a test was also added
---
 builtin/read.c   |  7 ++++++-
 test/meson.build |  1 +
 test/read.sh     | 17 +++++++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 test/read.sh

diff --git a/builtin/read.c b/builtin/read.c
index d014969..a0ce82e 100644
[message trimmed]

Re: [PATCH 1/2] add test for ub when processing args 9 months ago

From Stone Tickle to ~emersion/mrsh-dev

Please disregard this patch, I'm still figuring out git send-email.

[PATCH 1/2] add test for ub when processing args 9 months ago

From Stone Tickle to ~emersion/mrsh-dev

---
 args.sh          | 6 ++++++
 test/meson.build | 1 +
 2 files changed, 7 insertions(+)
 create mode 100644 args.sh

diff --git a/args.sh b/args.sh
new file mode 100644
index 0000000..a314dfd
--- /dev/null
+++ b/args.sh
@@ -0,0 +1,6 @@
func() { getopts "abcd" opt; }

[message trimmed]

[PATCH v2] Demonstrate that I can use git send-email! 9 months ago

From Stone Tickle to ~sircmpwn/email-test-drive

---
 stone-tickle | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 stone-tickle

diff --git a/stone-tickle b/stone-tickle
new file mode 100644
index 0000000..66cb3d4
--- /dev/null
+++ b/stone-tickle
@@ -0,0 +1 @@
I have successfully used git send-email!
-- 
2.24.1
[message trimmed]

[PATCH] Demonstrate that I can use git send-email! 9 months ago

From Stone Tickle to ~sircmpwn/email-test-drive

---
 stone-tickle | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 stone-tickle

diff --git a/stone-tickle b/stone-tickle
new file mode 100644
index 0000000..b4380e4
--- /dev/null
+++ b/stone-tickle
@@ -0,0 +1 @@
I'm about to try git send-email!
-- 
2.24.1
[message trimmed]

Re: Let's introduce ourselves 1 year, 27 days ago

From Stone Tickle to ~sircmpwn/free-writers-club

> If it was your choice, what kind of project would you work on full time?

Well, thats a hard question to answer.  I would be happy working on
basically anything that presents a reasonably difficult problem that can
be cleanly solved.  Usually being a web developer precludes this since
anything involving web technologies can't really be called a clean
solution.  I usually just invent problems to solve, and sometimes while
I'm solving those problems, I discover even better problems and move on
to those, et cetera.

So much stuff is just yak shaving, if I think too hard about it I start
questioning whether computers are even beneficial to society, or if we
programmers just keep inventing problems so we can have stuff to work
on.

Re: Let's introduce ourselves 1 year, 27 days ago

From Stone Tickle to ~sircmpwn/free-writers-club

> Did you use Zola to build both of them? How was your experience with it?

Yeah I used zola for both, as well as the https://rainbloom.xyz website.
I chose zola over static site generators written in go since I already
had rust set up on my computer.  I also didn't want to use one written
in a scripting language because they would likely be pretty slow in
comparison.

Pros are it gets the job done, has a zero-dependency binary, and it
compiles the site quickly (I haven't compared it to anything else
though).

Cons are it uses its own template language "Tera", which is "very
similar to Jinja2, Liquid or Twig." Why not just use one of those then?

Re: Let's introduce ourselves 1 year, 28 days ago

From Stone Tickle to ~sircmpwn/free-writers-club

Hello,

My name is Stone and I'm working part time as a web developer to pay the
bills.  I certainly don't enjoy it though, I really prefer the most
efficient software I can find/make.  Most of my free time is spent on
various projects which may or may not be interesting/useful to other
people.

Anyways, my quest for simplicity naturally led me to Drew's blog, and
about a year later I decided to try out blogging myself.  Mostly I plan
to write about my aforementioned projects, but I might post something
else.

My blog is here: https://mochiro.moe