mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-05 00:40:26 +00:00
Fixes ENVIRON$() to automatically add CHR$(0) to strings passed.
Closes #79
This commit is contained in:
parent
4472c12a73
commit
1d07a3c802
|
@ -21311,10 +21311,15 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
|||
|
||||
qbs *func_environ(qbs *name)
|
||||
{
|
||||
static char *withNull;
|
||||
withNull=(char*)malloc(name->len+1);
|
||||
withNull[name->len]=0;//add NULL terminator
|
||||
memcpy(withNull,name->chr,name->len);
|
||||
|
||||
static char *cp;
|
||||
static qbs *tqbs;
|
||||
static int32 bytes;
|
||||
cp=getenv((char*)name->chr);
|
||||
cp=getenv(withNull);
|
||||
if (cp){
|
||||
bytes=strlen(cp);
|
||||
tqbs=qbs_new(bytes,1);
|
||||
|
|
Loading…
Reference in a new issue