klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit dd43f846d8f3f0be00d3c53764d69f06b69d03d4
parent f68ac487af96d9b58f0d53ac794a88d53562af72
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Wed,  9 Mar 2011 17:04:21 -0300

Changed throw_extra to not insert a space between msgs. TODO: make it take any number of strings

Diffstat:
Msrc/kenvironment.c | 2+-
Msrc/kerror.c | 5++---
2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/kenvironment.c b/src/kenvironment.c @@ -82,7 +82,7 @@ TValue kget_binding(klisp_State *K, TValue env, TValue sym) env = kenv_parents(K, env); } - klispE_throw_extra(K, "Unbound symbol", ksymbol_buf(sym)); + klispE_throw_extra(K, "Unbound symbol: ", ksymbol_buf(sym)); /* avoid warning */ return KINERT; } diff --git a/src/kerror.c b/src/kerror.c @@ -34,10 +34,9 @@ void klispE_throw_extra(klisp_State *K, char *msg, char *extra_msg) { int32_t tl = l1+l2+1; - char *msg_buf = klispM_malloc(K, tl+1); + char *msg_buf = klispM_malloc(K, tl); strcpy(msg_buf, msg); - msg_buf[l1] = ' '; - strcpy(msg_buf+l1+1, extra_msg); + strcpy(msg_buf+l1, extra_msg); TValue error_msg = kstring_new(K, msg_buf, tl); klispM_freemem(K, msg_buf, tl+1);