version 1.28, 2012/08/25 08:12:56 |
version 1.29, 2012/09/21 07:55:20 |
|
|
* (e.g., not a backslash or a space. */ |
* (e.g., not a backslash or a space. */ |
static int skip_empty_lines_and_read_char(Buffer); |
static int skip_empty_lines_and_read_char(Buffer); |
|
|
|
const char *curdir; |
|
size_t curdir_len; |
|
|
|
void |
|
Parse_setcurdir(const char *dir) |
|
{ |
|
curdir = dir; |
|
curdir_len = strlen(dir); |
|
} |
|
|
|
static const char * |
|
simplify(const char *filename) |
|
{ |
|
if (strncmp(curdir, filename, curdir_len) == 0 && |
|
filename[curdir_len] == '/') |
|
return filename + curdir_len + 1; |
|
else |
|
return filename; |
|
} |
|
|
static struct input_stream * |
static struct input_stream * |
new_input_file(const char *name, FILE *stream) |
new_input_file(const char *name, FILE *stream) |
{ |
{ |
|
|
#endif |
#endif |
|
|
istream = emalloc(sizeof(*istream)); |
istream = emalloc(sizeof(*istream)); |
istream->origin.fname = name; |
istream->origin.fname = simplify(name); |
istream->str = NULL; |
istream->str = NULL; |
/* Naturally enough, we start reading at line 0. */ |
/* Naturally enough, we start reading at line 0. */ |
istream->origin.lineno = 0; |
istream->origin.lineno = 0; |