fix a comment bug reported by gnounc.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4577 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2014-01-13 02:33:11 +00:00
parent 90d981d8ef
commit 705e9ac9e8

View file

@ -1959,9 +1959,10 @@ void QCC_PR_LexWhitespace (pbool inhibitpreprocessor)
// skip /* */ comments // skip /* */ comments
if (c=='/' && pr_file_p[1] == '*') if (c=='/' && pr_file_p[1] == '*')
{ {
pr_file_p+=2; pr_file_p+=1;
do do
{ {
pr_file_p++;
if (pr_file_p[0]=='\n') if (pr_file_p[0]=='\n')
{ {
if (!inhibitpreprocessor) if (!inhibitpreprocessor)
@ -1973,7 +1974,6 @@ void QCC_PR_LexWhitespace (pbool inhibitpreprocessor)
pr_file_p++; pr_file_p++;
return; return;
} }
pr_file_p++;
} while (pr_file_p[0] != '*' || pr_file_p[1] != '/'); } while (pr_file_p[0] != '*' || pr_file_p[1] != '/');
pr_file_p+=2; pr_file_p+=2;
continue; continue;
@ -3309,27 +3309,26 @@ pbool QCC_PR_CheckTokenComment(char *string, char **comment)
// parse /* comments // parse /* comments
else if (c=='/' && pr_file_p[1] == '*' && replace) else if (c=='/' && pr_file_p[1] == '*' && replace)
{ {
pr_file_p+=2; pr_file_p+=1;
start = pr_file_p; start = pr_file_p+1;
do do
{ {
pr_file_p++;
if (pr_file_p[0]=='\n') if (pr_file_p[0]=='\n')
{ {
pr_file_p++;
QCC_PR_NewLine(true); QCC_PR_NewLine(true);
} }
else if (pr_file_p[1] == 0) else if (pr_file_p[1] == 0)
{ {
QCC_PR_ParseError(0, "EOF inside comment\n"); QCC_PR_ParseError(0, "EOF inside comment\n");
pr_file_p++;
pr_file_p-=2;
break; break;
} }
else
pr_file_p++;
} while (pr_file_p[0] != '*' || pr_file_p[1] != '/'); } while (pr_file_p[0] != '*' || pr_file_p[1] != '/');
if (pr_file_p[1] == 0)
break;
old = replace?NULL:*comment; old = replace?NULL:*comment;
replace = false; replace = false;
oldlen = old?strlen(old):0; oldlen = old?strlen(old):0;