@@ -97,7 +97,7 @@ static bool pass = false; /*
9797
9898static int blklevel ; /* current nesting level */
9999static int comtype ; /* type of comment */
100- static const char * defsfile [2 ] = { _PATH_VGRINDEFS , 0 };
100+ static char * defsfile [2 ] = { _PATH_VGRINDEFS , 0 };
101101 /* name of language definitions file */
102102static int margin ;
103103static int plstack [PSMAX ]; /* the procedure nesting level stack */
@@ -124,6 +124,7 @@ char *l_prcbeg; /* regular expr for procedure begin */
124124char * l_strbeg ; /* delimiter for string constant */
125125char * l_strend ; /* delimiter for string constant */
126126bool l_toplex ; /* procedures only defined at top lex level */
127+ bool l_dotaln ; /* dot is alphanumeric in this lang */
127128const char * language = "c" ; /* the language indicator */
128129
129130#define ps (x ) printf("%s", x)
@@ -280,6 +281,7 @@ main(int argc, char *argv[])
280281 l_escape = '\\' ;
281282 l_onecase = (cgetcap (defs , "oc" , ':' ) != NULL );
282283 l_toplex = (cgetcap (defs , "tl" , ':' ) != NULL );
284+ l_dotaln = (cgetcap (defs , "da" , ':' ) != NULL );
283285
284286 /* initialize the program */
285287
@@ -347,7 +349,7 @@ main(int argc, char *argv[])
347349 exit (0 );
348350}
349351
350- #define isidchr (c ) (isalnum((unsigned char)(c)) || (c) == '_')
352+ #define isidchr (c ) (isalnum((unsigned char)(c)) || (c) == '_' || (l_dotaln && (c) == '.') )
351353
352354static void
353355putScp (char * os )
@@ -657,6 +659,9 @@ putcp(int c)
657659 ps ("\\fI\\h'\\w' 'u-\\w'/'u'/\\fP" );
658660 break ;
659661
662+ case 015 : /* Ignore cr - most compilers don't care */
663+ break ;
664+
660665 default :
661666 if (c < 040 )
662667 putchar ('^' ), c |= '@' ;
0 commit comments