diff options
| author | Charles.Forsyth <devnull@localhost> | 2009-01-22 16:43:05 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2009-01-22 16:43:05 +0000 |
| commit | 3ca84fa3246c8fd45d7712981feb7e5701f9b55a (patch) | |
| tree | f740456515462e0b9b57550b2d3ec8719456e1cf | |
| parent | 35da2feea738176e4f6e98e412f28e4fdb79ceac (diff) | |
20090122-1642
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | include/version.h | 2 | ||||
| -rw-r--r-- | libinterp/string.c | 4 |
3 files changed, 7 insertions, 1 deletions
@@ -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); } |
