Better handling of macros and one line commands for standard predefines.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2637 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
icemank 2003-06-12 21:50:17 +00:00
parent 70a48ad5b8
commit b523639b83

View file

@ -450,21 +450,30 @@ int CEXEBuild::process_oneline(char *line, char *filename, int linenum)
char *oldfilename = NULL;
char *oldtimestamp = NULL;
char *oldline = NULL;
BOOL is_commandline = !lstrcmp(filename,"command line");
BOOL is_macro = !strncmp(filename,"macro:",lstrlen("macro:"));
if(lstrcmp(filename,"command line")) { // Don't set the predefines for command line /X option
oldfilename = set_file_predefine(curfilename);
oldtimestamp = set_timestamp_predefine(curfilename);
oldline = set_line_predefine(last_linecnt+linecnt-1); // This is done so that line numbers are
} //handled properly when macros are inserted.
if(!is_commandline) { // Don't set the predefines for command line /X option
if(is_macro) {
oldline = set_line_predefine(last_linecnt+linecnt-1); // This is done so that line numbers are
} //handled properly when macros are inserted.
else {
oldfilename = set_file_predefine(curfilename);
oldtimestamp = set_timestamp_predefine(curfilename);
oldline = set_line_predefine(linecnt);
}
}
#endif
ps_addtoline(line,linedata,hist);
#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
// Added by Sunil Kamath 11 June 2003
if(lstrcmp(filename,"command line")) { // Don't set the predefines for command line /X option
restore_file_predefine(oldfilename);
restore_timestamp_predefine(oldtimestamp);
if(!is_commandline) { // Don't set the predefines for command line /X option
if(!is_macro) {
restore_file_predefine(oldfilename);
restore_timestamp_predefine(oldtimestamp);
}
restore_line_predefine(oldline);
}
#endif