This file is indexed.

/usr/share/doc/flex/examples/manual/string1.lex is in flex 2.6.4-6.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* 
 * string1.lex: Handling strings by using input()
 */

%{
#include <ctype.h>
#include <malloc.h>

#define ALLOC_SIZE 32 /* for (re)allocating the buffer */                   

#define isodigit(x) ((x) >= '0' && (x) <= '7') 
#define hextoint(x) (isdigit((x)) ? (x) - '0' : ((x) - 'A') + 10)  

void yyerror(char *message)
{
  printf("\nError: %s\n",message);
}

%}

%%

\" {
     int  inch,count,max_size;
     char *buffer;
     int  temp;

     buffer   = malloc(ALLOC_SIZE);
     max_size = ALLOC_SIZE;
     inch     = input();
     count    = 0;
     while(inch != EOF && inch != '"' && inch != '\n'){
        if(inch == '\\'){
          inch = input();
          switch(inch){
          case '\n': inch = input(); break;
          case 'b' : inch = '\b';    break;
          case 't' : inch = '\t';    break;
          case 'n' : inch = '\n';    break;
          case 'v' : inch = '\v';    break;
          case 'f' : inch = '\f';    break;
          case 'r' : inch = '\r';    break;
          case 'X' :
          case 'x' : inch = input();
                     if(isxdigit(inch)){
                       temp = hextoint(toupper(inch));
                       inch = input();
                       if(isxdigit(inch)){
                         temp = (temp << 4) + hextoint(toupper(inch));
                       } else {
                         unput(inch);
                       }
                       inch = temp; 
                     } else {
                       unput(inch);
                       inch = 'x';
                     }
             break;
          default:
             if(isodigit(inch)){
                temp = inch - '0';
                inch = input();
                if(isodigit(inch)){
                  temp = (temp << 3) + (inch - '0');
                } else {
                  unput(inch);
                  goto done;
                }
                inch = input();
                if(isodigit(inch)){
                  temp = (temp << 3) + (inch - '0');
                } else {
                  unput(inch);
                }
             done:
                inch = temp; 
             }
          } 
        }
        buffer[count++] = inch;
        if(count >= max_size){
           buffer = realloc(buffer,max_size + ALLOC_SIZE);
           max_size += ALLOC_SIZE;
        }           
        inch = input();
     }
     if(inch == EOF || inch == '\n'){
       yyerror("Unterminated string.");
     }
     buffer[count] = '\0';
     printf("String = \"%s\"\n",buffer);
     free(buffer);
   }
.
\n
%%