From: Richard Stallman Date: Fri, 26 Feb 1993 23:56:02 +0000 (+0000) Subject: (do_include): Correctly report the directive name X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=33b039cc748f66e171d5c08fdaf3a811682976e6;p=gcc.git (do_include): Correctly report the directive name when any kind of include directive has no argument or null argument. From-SVN: r3546 --- diff --git a/gcc/cccp.c b/gcc/cccp.c index 0ec57705320..5e0d2f8f963 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -3844,11 +3844,8 @@ get_filename: default: fail: if (retried) { - if (importing) - error ("`#import' expects \"fname\" or "); - else - error ("`#include' expects \"fname\" or "); - return 0; + fend = fbeg; + break; } else { trybuf = expand_to_temp_buffer (buf, limit, 0, 0); buf = (U_CHAR *) alloca (trybuf.bufp - trybuf.buf + 1); @@ -3875,6 +3872,13 @@ get_filename: } flen = fend - fbeg; + + if (flen == 0) + { + error ("`#%s' expects \"fname\" or ", keyword->name); + return 0; + } + /* Allocate this permanently, because it gets stored in the definitions of macros. */ fname = (char *) xmalloc (max_include_len + flen + 2);