Allow #pragma option -c####.

This commit is contained in:
Y_Less 2017-10-28 14:53:59 +02:00
parent 0f86097c99
commit f71d55d380

View File

@ -1053,7 +1053,6 @@ static void parseoptions(int argc,char **argv,char *oname,char *ename,char *pnam
#endif #endif
break; break;
case 'c': case 'c':
if (codepage)
strlcpy(codepage,option_value(ptr),MAXCODEPAGE); /* set name of codepage */ strlcpy(codepage,option_value(ptr),MAXCODEPAGE); /* set name of codepage */
break; break;
case 'D': /* set active directory */ case 'D': /* set active directory */
@ -1272,8 +1271,14 @@ static void parseoptions(int argc,char **argv,char *oname,char *ename,char *pnam
void parsesingleoption(char *argv) void parsesingleoption(char *argv)
{ {
/* argv[0] is the program, which we don't need here */
char *args[2] = { 0, argv }; char *args[2] = { 0, argv };
parseoptions(2, args, NULL, NULL, NULL, NULL, NULL); char codepage[MAXCODEPAGE+1] = { 0 };
codepage[0] = '\0';
parseoptions(2, args, NULL, NULL, NULL, NULL, codepage);
/* need explicit support for codepages */
if (codepage[0] && !cp_set(codepage))
error(108); /* codepage mapping file not found */
} }
#if !defined SC_LIGHT #if !defined SC_LIGHT