MCPcopy Create free account
hub / github.com/boostorg/build / globchars

Function globchars

v2/engine/glob.c:114–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 */
113
114static void globchars( const char * s, const char * e, char * b )
115{
116 int neg = 0;
117
118 memset( b, '\0', BITLISTSIZE );
119
120 if ( *s == '^' )
121 {
122 ++neg;
123 ++s;
124 }
125
126 while ( s < e )
127 {
128 int c;
129
130 if ( ( s + 2 < e ) && ( s[1] == '-' ) )
131 {
132 for ( c = s[0]; c <= s[2]; ++c )
133 b[ c/8 ] |= ( 1 << ( c % 8 ) );
134 s += 3;
135 }
136 else
137 {
138 c = *s++;
139 b[ c/8 ] |= ( 1 << ( c % 8 ) );
140 }
141 }
142
143 if ( neg )
144 {
145 int i;
146 for ( i = 0; i < BITLISTSIZE; ++i )
147 b[ i ] ^= 0377;
148 }
149
150 /* Do not include \0 in either $[chars] or $[^chars]. */
151 b[0] &= 0376;
152}

Callers 1

globFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected