diff options
Diffstat (limited to 'tests/rscript.c')
-rw-r--r-- | tests/rscript.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/rscript.c b/tests/rscript.c index 4906f91a..6b232f5f 100644 --- a/tests/rscript.c +++ b/tests/rscript.c @@ -40,37 +40,6 @@ DEFobjCurrIf(ctok_token) DEFobjCurrIf(vmprg) -/* we emulate getline (the dirty way) if we do not have it - * We do not try very hard, as this is just a test driver. - * rgerhards, 2009-03-31 - */ -#ifndef HAVE_GETLINE -ssize_t getline(char **lineptr, size_t *n, FILE *fp) -{ - int c; - int len = 0; - - if(*lineptr == NULL) - *lineptr = malloc(1024); /* quick and dirty! */ - - c = fgetc(fp); - while(c != EOF && c != '\n') { - (*lineptr)[len++] = c; - c = fgetc(fp); - } - if(c != EOF) /* need to add NL? */ - (*lineptr)[len++] = c; - - (*lineptr)[len] = '\0'; - - *n = len; - //printf("getline returns: '%s'\n", *lineptr); - - return (len > 0) ? len : -1; -} -#endif /* #ifndef HAVE_GETLINE */ - - BEGINInit CODESTARTInit pErrObj = "expr"; CHKiRet(objUse(expr, CORE_COMPONENT)); |