# HG changeset patch # User kono # Date 1136024659 -32400 # Node ID 00da98433e638a6eaaa72464e063fffade1a475e # Parent f9c6976ba270b87248a55b393e304e4912119872 macro arg continuation diff -r f9c6976ba270 -r 00da98433e63 mc-macro.c --- a/mc-macro.c Sat Dec 31 17:28:49 2005 +0900 +++ b/mc-macro.c Sat Dec 31 19:24:19 2005 +0900 @@ -139,8 +139,7 @@ if (fp) { p = name; } else { - for(pp=(end=='>'||filep->inc=='>') ?l_include_path:include_path; - *pp;pp++) { + for(pp=include_path; *pp;pp++) { // "" and <> case p = expand_file_name(*pp,name); if ((fp = fopen(p,"r"))) { if (next) { @@ -150,6 +149,18 @@ break ; } } + if (!fp && (end=='>'||filep->inc=='>')) { // <> case only + for(pp=l_include_path; *pp;pp++) { + p = expand_file_name(*pp,name); + if ((fp = fopen(p,"r"))) { + if (next) { + fclose(fp); fp=0; next=0; + continue; + } else + break ; + } + } + } } if(!fp) { error(FILERR); return filep->fcb; } copy_current_file_dir(s=p); @@ -578,6 +589,14 @@ for(;;) { *cheap->ptr = c = *chptr++; cheap = increment_cheap(cheap,body); + if (c=='\\') { + if (*chptr=='\n') { + cheap->ptr--; + getline(); + chptr = *pchptr; + continue; + } + } if (!c) { chptr--; error(MCERR); @@ -591,6 +610,7 @@ cheap = increment_cheap(cheap,body); } else { getline(); + chptr = *pchptr; } } else if (c=='\'') { in_quote = 0; @@ -603,6 +623,7 @@ } else { *cheap->ptr = '\n'; getline(); + chptr = *pchptr; } } else if (c=='"') { in_wquote = 0; @@ -625,6 +646,7 @@ if (*chptr=='\n') { cheap->ptr--; getline(); + chptr = *pchptr; } // } else if (c==' '||c=='\t') { // cheap->ptr--; diff -r f9c6976ba270 -r 00da98433e63 mc-parse.c --- a/mc-parse.c Sat Dec 31 17:28:49 2005 +0900 +++ b/mc-parse.c Sat Dec 31 19:24:19 2005 +0900 @@ -765,6 +765,7 @@ if(sym==LC || ( sym!=SM && sym!=COMMA && sym!=ASS)) { /* function body */ if (mode!=GDECL) error(DCERR); + if (type<0) error(DCERR); stypedecl=sd; if (car(type)==CODE) { code_decl(n); return; @@ -4399,6 +4400,7 @@ chsave = j; return ch; } + if (!filep) return ch=0; // command line case; getline(); if (in_macro_if) check_macro_eof(); return getch();