8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / vgrind / retest.c
blob5b01a98b00c27cc498c3372572c9ea939ca7f712
1 /*
2 * Copyright (c) 1980 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
7 #pragma ident "%Z%%M% %I% %E% SMI"
8 /* from UCB 5.1 (Berkeley) 6/5/85 */
10 #include <ctype.h>
12 int l_onecase = 0;
14 char *l_idchars = "_"; /* characters legal in identifiers in addition
15 to alphanumerics */
17 char * Start;
18 char * _escaped;
19 char * convexp();
20 char * expmatch();
21 main()
23 char reg[132];
24 char *ireg;
25 char str[132];
26 char *match;
27 char matstr[132];
28 char c;
30 while (1) {
31 printf ("\nexpr: ");
32 scanf ("%s", reg);
33 ireg = convexp(reg);
34 match = ireg;
35 while(*match) {
36 switch (*match) {
38 case '\\':
39 case '(':
40 case ')':
41 case '|':
42 printf ("%c", *match);
43 break;
45 default:
46 if (isalnum(*match))
47 printf("%c", *match);
48 else
49 printf ("<%03o>", *match);
50 break;
52 match++;
54 printf("\n");
55 getchar();
56 while(1) {
57 printf ("string: ");
58 match = str;
59 while ((c = getchar()) != '\n')
60 *match++ = c;
61 *match = 0;
62 if (str[0] == '#')
63 break;
64 matstr[0] = 0;
65 Start = str;
66 _escaped = 0;
67 match = expmatch (str, ireg, matstr);
68 if (match == 0)
69 printf ("FAILED\n");
70 else
71 printf ("match\nmatstr = %s\n", matstr);