summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
Diffstat (limited to 'addons')
-rw-r--r--addons/fake/fake.c2
-rw-r--r--addons/image/image.c4
-rw-r--r--addons/snake/snake.c1
3 files changed, 5 insertions, 2 deletions
diff --git a/addons/fake/fake.c b/addons/fake/fake.c
index 818c8ea3..81a78741 100644
--- a/addons/fake/fake.c
+++ b/addons/fake/fake.c
@@ -76,7 +76,7 @@ static void paint(void *st, const pa_window *w, pa_paint *out) {
static int key(void *st, const pa_key *k) {
fake *f = st;
- if (k->cp == 'q') return 0; /* not taken: the core's */
+ if (k->cp == 'q' || k->cp == 0x1b) return 0; /* not taken: the core's (Esc leaves) */
f->count++;
f->last[0] = 'k';
f->last[1] = k->cp < 128 ? (char)k->cp : '?';
diff --git a/addons/image/image.c b/addons/image/image.c
index f7a228c8..1aa34428 100644
--- a/addons/image/image.c
+++ b/addons/image/image.c
@@ -131,10 +131,12 @@ static uint32_t dump(void *st, uint8_t *buf, uint32_t n) {
return im->len;
}
+/* On a state with no picture (a Restore's), the record's; one open made
+ * from the file as it is now (it changed on disk) keeps that one. */
static int load(void *st, const uint8_t *buf, uint32_t n, uint32_t version) {
(void)version;
if (!st) return 1;
- keep(st, buf, n);
+ if (!((image *)st)->raw) keep(st, buf, n);
return PA_OK;
}
diff --git a/addons/snake/snake.c b/addons/snake/snake.c
index e6ad96e4..ce9279dc 100644
--- a/addons/snake/snake.c
+++ b/addons/snake/snake.c
@@ -109,6 +109,7 @@ static void paint(void *st, const pa_window *w, pa_paint *out) {
static int key(void *st, const pa_key *k) {
snake *s = st;
+ if (k->cp == 0x1b) return 0; /* Esc leaves */
if (s->dead) { restart(s); return 1; }
int dx = 0, dy = 0;
switch (k->cp) {