summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--include/version.h2
-rw-r--r--libinterp/string.c4
3 files changed, 7 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 92f76fc8..5f9ba509 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,6 @@
20081119
+20090122
+ libinterp/string.c: slicer can return H for empty slice after bounds check
os/pc/^(main.c fns.h) more idle idlehands
20081112
emu/Linux/asm-arm.S old failure to use different regs for swp finally changed here
diff --git a/include/version.h b/include/version.h
index eaf0f8ac..65643b7c 100644
--- a/include/version.h
+++ b/include/version.h
@@ -1 +1 @@
-#define VERSION "Fourth Edition (20081119)"
+#define VERSION "Fourth Edition (20090122)"
diff --git a/libinterp/string.c b/libinterp/string.c
index 4a4eb54e..32320d56 100644
--- a/libinterp/string.c
+++ b/libinterp/string.c
@@ -131,6 +131,8 @@ slicer(ulong start, ulong v, String *ds)
l = -ds->len;
if(v < start || v > l)
error(exBounds);
+ if(nc == 0)
+ return H;
ns = newrunes(nc);
memmove(ns->Srune, &ds->Srune[start], nc*sizeof(Rune));
}
@@ -138,6 +140,8 @@ slicer(ulong start, ulong v, String *ds)
l = ds->len;
if(v < start || v > l)
error(exBounds);
+ if(nc == 0)
+ return H;
ns = newstring(nc);
memmove(ns->Sascii, &ds->Sascii[start], nc);
}