OpenCoverage

shquote.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/lib/sh/shquote.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11extern char *ansic_quote (char *, int, int *);-
12extern int ansic_shouldquote (const char *);-
13-
14-
15static const char bstab[256] =-
16 {-
17 0, 0, 0, 0, 0, 0, 0, 0,-
18 0, 1, 1, 0, 0, 0, 0, 0,-
19 0, 0, 0, 0, 0, 0, 0, 0,-
20 0, 0, 0, 0, 0, 0, 0, 0,-
21-
22 1, 1, 1, 0, 1, 0, 1, 1,-
23 1, 1, 1, 0, 1, 0, 0, 0,-
24 0, 0, 0, 0, 0, 0, 0, 0,-
25 0, 0, 0, 1, 1, 0, 1, 1,-
26-
27 0, 0, 0, 0, 0, 0, 0, 0,-
28 0, 0, 0, 0, 0, 0, 0, 0,-
29 0, 0, 0, 0, 0, 0, 0, 0,-
30 0, 0, 0, 1, 1, 1, 1, 0,-
31-
32 1, 0, 0, 0, 0, 0, 0, 0,-
33 0, 0, 0, 0, 0, 0, 0, 0,-
34 0, 0, 0, 0, 0, 0, 0, 0,-
35 0, 0, 0, 1, 1, 1, 0, 0,-
36-
37 0, 0, 0, 0, 0, 0, 0, 0,-
38 0, 0, 0, 0, 0, 0, 0, 0,-
39 0, 0, 0, 0, 0, 0, 0, 0,-
40 0, 0, 0, 0, 0, 0, 0, 0,-
41-
42 0, 0, 0, 0, 0, 0, 0, 0,-
43 0, 0, 0, 0, 0, 0, 0, 0,-
44 0, 0, 0, 0, 0, 0, 0, 0,-
45 0, 0, 0, 0, 0, 0, 0, 0,-
46-
47 0, 0, 0, 0, 0, 0, 0, 0,-
48 0, 0, 0, 0, 0, 0, 0, 0,-
49 0, 0, 0, 0, 0, 0, 0, 0,-
50 0, 0, 0, 0, 0, 0, 0, 0,-
51-
52 0, 0, 0, 0, 0, 0, 0, 0,-
53 0, 0, 0, 0, 0, 0, 0, 0,-
54 0, 0, 0, 0, 0, 0, 0, 0,-
55 0, 0, 0, 0, 0, 0, 0, 0,-
56 };-
57char *-
58sh_single_quote (string)-
59 const char *string;-
60{-
61 register int c;-
62 char *result, *r;-
63 const char *s;-
64-
65 result = (char *)sh_xmalloc((3 + (4 * strlen (string))), "shquote.c", 102);-
66 r = result;-
67-
68 if (string[0] == '\''
string[0] == '\''Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2948 times by 1 test
Evaluated by:
  • Self test
&& string[1] == 0
string[1] == 0Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test
)
7-2948
69 {-
70 *r++ = '\\';-
71 *r++ = '\'';-
72 *r++ = 0;-
73 return
executed 15 times by 1 test: return result;
Executed by:
  • Self test
result;
executed 15 times by 1 test: return result;
Executed by:
  • Self test
15
74 }-
75-
76 *r++ = '\'';-
77-
78 for (s = string; s
sDescription
TRUEevaluated 13989 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& (
(c = *s)Description
TRUEevaluated 11034 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2955 times by 1 test
Evaluated by:
  • Self test
c = *s)
(c = *s)Description
TRUEevaluated 11034 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2955 times by 1 test
Evaluated by:
  • Self test
; s++)
0-13989
79 {-
80 *r++ = c;-
81-
82 if (c == '\''
c == '\''Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 11011 times by 1 test
Evaluated by:
  • Self test
)
23-11011
83 {-
84 *r++ = '\\';-
85 *r++ = '\'';-
86 *r++ = '\'';-
87 }
executed 23 times by 1 test: end of block
Executed by:
  • Self test
23
88 }
executed 11034 times by 1 test: end of block
Executed by:
  • Self test
11034
89-
90 *r++ = '\'';-
91 *r = '\0';-
92-
93 return
executed 2955 times by 1 test: return (result);
Executed by:
  • Self test
(result);
executed 2955 times by 1 test: return (result);
Executed by:
  • Self test
2955
94}-
95-
96-
97char *-
98sh_double_quote (string)-
99 const char *string;-
100{-
101 register unsigned char c;-
102 char *result, *r;-
103 const char *s;-
104-
105 result = (char *)sh_xmalloc((3 + (2 * strlen (string))), "shquote.c", 142);-
106 r = result;-
107 *r++ = '"';-
108-
109 for (s = string; s
sDescription
TRUEevaluated 4669 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& (
(c = *s)Description
TRUEevaluated 3701 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 968 times by 1 test
Evaluated by:
  • Self test
c = *s)
(c = *s)Description
TRUEevaluated 3701 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 968 times by 1 test
Evaluated by:
  • Self test
; s++)
0-4669
110 {-
111-
112 if ((
(sh_syntaxtab[c] & 0x0040)Description
TRUEevaluated 83 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3618 times by 1 test
Evaluated by:
  • Self test
sh_syntaxtab[c] & 0x0040)
(sh_syntaxtab[c] & 0x0040)Description
TRUEevaluated 83 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3618 times by 1 test
Evaluated by:
  • Self test
&& c != '\n'
c != '\n'Description
TRUEevaluated 83 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-3618
113 *
executed 83 times by 1 test: *r++ = '\\';
Executed by:
  • Self test
r++ = '\\';
executed 83 times by 1 test: *r++ = '\\';
Executed by:
  • Self test
83
114-
115-
116-
117-
118-
119-
120 *r++ = c;-
121 }
executed 3701 times by 1 test: end of block
Executed by:
  • Self test
3701
122-
123 *r++ = '"';-
124 *r = '\0';-
125-
126 return
executed 968 times by 1 test: return (result);
Executed by:
  • Self test
(result);
executed 968 times by 1 test: return (result);
Executed by:
  • Self test
968
127}-
128-
129-
130-
131char *-
132sh_mkdoublequoted (s, slen, flags)-
133 const char *s;-
134 int slen, flags;-
135{-
136 char *r, *ret;-
137 int rlen;-
138-
139 rlen = (
(flags == 0)Description
TRUEevaluated 35 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags == 0)
(flags == 0)Description
TRUEevaluated 35 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
? slen + 3 : (2 * slen) + 1;
0-35
140 ret = r = (char *)sh_xmalloc((rlen), "shquote.c", 177);-
141-
142 *r++ = '"';-
143 while (*
*sDescription
TRUEevaluated 290 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35 times by 1 test
Evaluated by:
  • Self test
s
*sDescription
TRUEevaluated 290 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35 times by 1 test
Evaluated by:
  • Self test
)
35-290
144 {-
145 if (flags
flagsDescription
TRUEnever evaluated
FALSEevaluated 290 times by 1 test
Evaluated by:
  • Self test
&& *
*s == '"'Description
TRUEnever evaluated
FALSEnever evaluated
s == '"'
*s == '"'Description
TRUEnever evaluated
FALSEnever evaluated
)
0-290
146 *
never executed: *r++ = '\\';
r++ = '\\';
never executed: *r++ = '\\';
0
147 *r++ = *s++;-
148 }
executed 290 times by 1 test: end of block
Executed by:
  • Self test
290
149 *r++ = '"';-
150 *r = '\0';-
151-
152 return
executed 35 times by 1 test: return ret;
Executed by:
  • Self test
ret;
executed 35 times by 1 test: return ret;
Executed by:
  • Self test
35
153}-
154-
155-
156-
157-
158char *-
159sh_un_double_quote (string)-
160 char *string;-
161{-
162 register int c, pass_next;-
163 char *result, *r, *s;-
164-
165 r = result = (char *)sh_xmalloc((strlen (string) + 1), "shquote.c", 202);-
166-
167 for (pass_next = 0, s = string; s
sDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(c = *s)Description
TRUEnever evaluated
FALSEnever evaluated
c = *s)
(c = *s)Description
TRUEnever evaluated
FALSEnever evaluated
; s++)
0
168 {-
169 if (pass_next
pass_nextDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
170 {-
171 *r++ = c;-
172 pass_next = 0;-
173 continue;
never executed: continue;
0
174 }-
175 if (c == '\\'
c == '\\'Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(sh_syntaxtab[...[1]] & 0x0040)Description
TRUEnever evaluated
FALSEnever evaluated
sh_syntaxtab[(unsigned char) s[1]] & 0x0040)
(sh_syntaxtab[...[1]] & 0x0040)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
176 {-
177 pass_next = 1;-
178 continue;
never executed: continue;
0
179 }-
180 *r++ = c;-
181 }
never executed: end of block
0
182-
183 *r = '\0';-
184 return
never executed: return result;
result;
never executed: return result;
0
185}-
186char *-
187sh_backslash_quote (string, table, flags)-
188 char *string;-
189 char *table;-
190 int flags;-
191{-
192 int c, mb_cur_max;-
193 size_t slen;-
194 char *result, *r, *s, *backslash_table, *send;-
195 mbstate_t state; memset (&state, '\0', sizeof (mbstate_t));-
196-
197 slen = strlen (string);-
198 send = string + slen;-
199 result = (char *)sh_xmalloc((2 * slen + 1), "shquote.c", 247);-
200-
201 backslash_table = table
tableDescription
TRUEnever evaluated
FALSEevaluated 541 times by 1 test
Evaluated by:
  • Self test
? table : (char *)bstab;
0-541
202 mb_cur_max = -
203 (__ctype_get_mb_cur_max ())-
204 ;-
205-
206 for (r = result, s = string; s
sDescription
TRUEevaluated 3221 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& (
(c = *s)Description
TRUEevaluated 2680 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 541 times by 1 test
Evaluated by:
  • Self test
c = *s)
(c = *s)Description
TRUEevaluated 2680 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 541 times by 1 test
Evaluated by:
  • Self test
; s++)
0-3221
207 {-
208-
209-
210 if (c >= 0
c >= 0Description
TRUEevaluated 2586 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 94 times by 1 test
Evaluated by:
  • Self test
&& c <= 127
c <= 127Description
TRUEevaluated 2586 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& backslash_table[(unsigned char)c] == 1
backslash_tabl...d char)c] == 1Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2579 times by 1 test
Evaluated by:
  • Self test
)
0-2586
211 {-
212 *r++ = '\\';-
213 *r++ = c;-
214 continue;
executed 7 times by 1 test: continue;
Executed by:
  • Self test
7
215 }-
216 if (mb_cur_max > 1
mb_cur_max > 1Description
TRUEevaluated 95 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2578 times by 1 test
Evaluated by:
  • Self test
&& is_basic (c) == 0
is_basic (c) == 0Description
TRUEevaluated 94 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
)
1-2578
217 {-
218 do { if (locale_mb_cur_max > 1
locale_mb_cur_max > 1Description
TRUEevaluated 94 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic (*(s)); if (_k
_kDescription
TRUEnever evaluated
FALSEevaluated 94 times by 1 test
Evaluated by:
  • Self test
) mblength = 1;
never executed: mblength = 1;
else if (locale_utf8locale
locale_utf8localeDescription
TRUEevaluated 94 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& ((*(
((*(s) & 0x80) == 0)Description
TRUEnever evaluated
FALSEevaluated 94 times by 1 test
Evaluated by:
  • Self test
s) & 0x80) == 0)
((*(s) & 0x80) == 0)Description
TRUEnever evaluated
FALSEevaluated 94 times by 1 test
Evaluated by:
  • Self test
) mblength = 1;
never executed: mblength = 1;
else { state_bak = state; mblength = mbrlen ((s), (send) - (s), &state); }
executed 94 times by 1 test: end of block
Executed by:
  • Self test
if (mblength == (size_t)-2
mblength == (size_t)-2Description
TRUEnever evaluated
FALSEevaluated 94 times by 1 test
Evaluated by:
  • Self test
|| mblength == (size_t)-1
mblength == (size_t)-1Description
TRUEnever evaluated
FALSEevaluated 94 times by 1 test
Evaluated by:
  • Self test
) { state = state_bak; mblength = 1; }
never executed: end of block
else mblength = (
(mblength < 1)Description
TRUEnever evaluated
FALSEevaluated 94 times by 1 test
Evaluated by:
  • Self test
mblength < 1)
(mblength < 1)Description
TRUEnever evaluated
FALSEevaluated 94 times by 1 test
Evaluated by:
  • Self test
? 1 : mblength;
executed 94 times by 1 test: mblength = (mblength < 1) ? 1 : mblength;
Executed by:
  • Self test
for (_k = 0; _k < mblength
_k < mblengthDescription
TRUEevaluated 188 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 94 times by 1 test
Evaluated by:
  • Self test
; _k++) *(
executed 188 times by 1 test: *(r)++ = *(s)++;
Executed by:
  • Self test
r)++ = *(s)++;
executed 188 times by 1 test: *(r)++ = *(s)++;
Executed by:
  • Self test
}
executed 94 times by 1 test: end of block
Executed by:
  • Self test
else *(
never executed: *(r)++ = *(s)++;
r)++ = *(s)++;
never executed: *(r)++ = *(s)++;
} while (0);
0-188
219 s--;-
220 continue;
executed 94 times by 1 test: continue;
Executed by:
  • Self test
94
221 }-
222-
223 if (backslash_table[(unsigned char)c] == 1
backslash_tabl...d char)c] == 1Description
TRUEnever evaluated
FALSEevaluated 2579 times by 1 test
Evaluated by:
  • Self test
)
0-2579
224 *
never executed: *r++ = '\\';
r++ = '\\';
never executed: *r++ = '\\';
0
225 else if (c == '#'
c == '#'Description
TRUEnever evaluated
FALSEevaluated 2579 times by 1 test
Evaluated by:
  • Self test
&& s == string
s == stringDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-2579
226 *
never executed: *r++ = '\\';
r++ = '\\';
never executed: *r++ = '\\';
0
227 else if ((
(flags&1)Description
TRUEevaluated 2579 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags&1)
(flags&1)Description
TRUEevaluated 2579 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& c == '~'
c == '~'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2578 times by 1 test
Evaluated by:
  • Self test
&& (s == string
s == stringDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
|| s[-1] == ':'
s[-1] == ':'Description
TRUEnever evaluated
FALSEnever evaluated
|| s[-1] == '='
s[-1] == '='Description
TRUEnever evaluated
FALSEnever evaluated
))
0-2579
228-
229-
230 *
executed 1 time by 1 test: *r++ = '\\';
Executed by:
  • Self test
r++ = '\\';
executed 1 time by 1 test: *r++ = '\\';
Executed by:
  • Self test
1
231 else if ((
(flags&2)Description
TRUEevaluated 2578 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags&2)
(flags&2)Description
TRUEevaluated 2578 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& (
(sh_syntaxtab[...)c)] & 0x2000)Description
TRUEnever evaluated
FALSEevaluated 2578 times by 1 test
Evaluated by:
  • Self test
sh_syntaxtab[(unsigned char)((unsigned char)c)] & 0x2000)
(sh_syntaxtab[...)c)] & 0x2000)Description
TRUEnever evaluated
FALSEevaluated 2578 times by 1 test
Evaluated by:
  • Self test
)
0-2578
232 *
never executed: *r++ = '\\';
r++ = '\\';
never executed: *r++ = '\\';
0
233 *r++ = c;-
234 }
executed 2579 times by 1 test: end of block
Executed by:
  • Self test
2579
235-
236 *r = '\0';-
237 return
executed 541 times by 1 test: return (result);
Executed by:
  • Self test
(result);
executed 541 times by 1 test: return (result);
Executed by:
  • Self test
541
238}-
239-
240-
241-
242-
243char *-
244sh_backslash_quote_for_double_quotes (string)-
245 char *string;-
246{-
247 unsigned char c;-
248 char *result, *r, *s;-
249-
250 result = (char *)sh_xmalloc((2 * strlen (string) + 1), "shquote.c", 296);-
251-
252 for (r = result, s = string; s
sDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(c = *s)Description
TRUEnever evaluated
FALSEnever evaluated
c = *s)
(c = *s)Description
TRUEnever evaluated
FALSEnever evaluated
; s++)
0
253 {-
254 if (sh_syntaxtab[c] & 0x0040
sh_syntaxtab[c] & 0x0040Description
TRUEnever evaluated
FALSEnever evaluated
)
0
255 *
never executed: *r++ = '\\';
r++ = '\\';
never executed: *r++ = '\\';
0
256-
257 else if (c == '\001'
c == '\001'Description
TRUEnever evaluated
FALSEnever evaluated
|| c == '\177'
c == '\177'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
258 *
never executed: *r++ = '\001';
r++ = '\001';
never executed: *r++ = '\001';
0
259-
260 *r++ = c;-
261 }
never executed: end of block
0
262-
263 *r = '\0';-
264 return
never executed: return (result);
(result);
never executed: return (result);
0
265}-
266-
267-
268char *-
269sh_quote_reusable (s, flags)-
270 char *s;-
271 int flags;-
272{-
273 char *ret;-
274-
275 if (s == 0
s == 0Description
TRUEnever evaluated
FALSEevaluated 49 times by 1 test
Evaluated by:
  • Self test
)
0-49
276 return
never executed: return s;
s;
never executed: return s;
0
277 else if (*
*s == 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 44 times by 1 test
Evaluated by:
  • Self test
s == 0
*s == 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 44 times by 1 test
Evaluated by:
  • Self test
)
5-44
278 {-
279 ret = (char *)sh_xmalloc((3), "shquote.c", 325);-
280 ret[0] = ret[1] = '\'';-
281 ret[2] = '\0';-
282 }
executed 5 times by 1 test: end of block
Executed by:
  • Self test
5
283 else if (ansic_shouldquote (s)
ansic_shouldquote (s)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 41 times by 1 test
Evaluated by:
  • Self test
)
3-41
284 ret = ansic_quote (s, 0, (int *)0);
executed 3 times by 1 test: ret = ansic_quote (s, 0, (int *)0);
Executed by:
  • Self test
3
285 else if (flags
flagsDescription
TRUEnever evaluated
FALSEevaluated 41 times by 1 test
Evaluated by:
  • Self test
)
0-41
286 ret = sh_backslash_quote (s, 0, 1);
never executed: ret = sh_backslash_quote (s, 0, 1);
0
287 else-
288 ret = sh_single_quote (s);
executed 41 times by 1 test: ret = sh_single_quote (s);
Executed by:
  • Self test
41
289-
290 return
executed 49 times by 1 test: return ret;
Executed by:
  • Self test
ret;
executed 49 times by 1 test: return ret;
Executed by:
  • Self test
49
291}-
292-
293int-
294sh_contains_shell_metas (string)-
295 const char *string;-
296{-
297 const char *s;-
298-
299 for (s = string; s
sDescription
TRUEevaluated 6077 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& *
*sDescription
TRUEevaluated 5636 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 441 times by 1 test
Evaluated by:
  • Self test
s
*sDescription
TRUEevaluated 5636 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 441 times by 1 test
Evaluated by:
  • Self test
; s++)
0-6077
300 {-
301 switch (*s)-
302 {-
303 case
executed 27 times by 1 test: case ' ':
Executed by:
  • Self test
' ':
executed 27 times by 1 test: case ' ':
Executed by:
  • Self test
case
never executed: case '\t':
'\t':
never executed: case '\t':
case
never executed: case '\n':
'\n':
never executed: case '\n':
0-27
304 case
executed 16 times by 1 test: case '\'':
Executed by:
  • Self test
'\'':
executed 16 times by 1 test: case '\'':
Executed by:
  • Self test
case
executed 12 times by 1 test: case '"':
Executed by:
  • Self test
'"':
executed 12 times by 1 test: case '"':
Executed by:
  • Self test
case
executed 6 times by 1 test: case '\\':
Executed by:
  • Self test
'\\':
executed 6 times by 1 test: case '\\':
Executed by:
  • Self test
6-16
305 case
never executed: case '|':
'|':
never executed: case '|':
case
never executed: case '&':
'&':
never executed: case '&':
case
never executed: case ';':
';':
never executed: case ';':
0
306 case
executed 6 times by 1 test: case '(':
Executed by:
  • Self test
'(':
executed 6 times by 1 test: case '(':
Executed by:
  • Self test
case
executed 1 time by 1 test: case ')':
Executed by:
  • Self test
')':
executed 1 time by 1 test: case ')':
Executed by:
  • Self test
case
never executed: case '<':
'<':
never executed: case '<':
case
never executed: case '>':
'>':
never executed: case '>':
0-6
307 case
never executed: case '!':
'!':
never executed: case '!':
case
never executed: case '{':
'{':
never executed: case '{':
case
never executed: case '}':
'}':
never executed: case '}':
0
308 case
never executed: case '*':
'*':
never executed: case '*':
case
executed 2 times by 1 test: case '[':
Executed by:
  • Self test
'[':
executed 2 times by 1 test: case '[':
Executed by:
  • Self test
case
never executed: case '?':
'?':
never executed: case '?':
case
executed 11 times by 1 test: case ']':
Executed by:
  • Self test
']':
executed 11 times by 1 test: case ']':
Executed by:
  • Self test
0-11
309 case
never executed: case '^':
'^':
never executed: case '^':
0
310 case
executed 3 times by 1 test: case '$':
Executed by:
  • Self test
'$':
executed 3 times by 1 test: case '$':
Executed by:
  • Self test
case
executed 6 times by 1 test: case '`':
Executed by:
  • Self test
'`':
executed 6 times by 1 test: case '`':
Executed by:
  • Self test
3-6
311 return
executed 90 times by 1 test: return (1);
Executed by:
  • Self test
(1);
executed 90 times by 1 test: return (1);
Executed by:
  • Self test
90
312 case
executed 3 times by 1 test: case '~':
Executed by:
  • Self test
'~':
executed 3 times by 1 test: case '~':
Executed by:
  • Self test
3
313 if (s == string
s == stringDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
|| s[-1] == '='
s[-1] == '='Description
TRUEnever evaluated
FALSEnever evaluated
|| s[-1] == ':'
s[-1] == ':'Description
TRUEnever evaluated
FALSEnever evaluated
)
0-3
314 return
executed 3 times by 1 test: return (1);
Executed by:
  • Self test
(1);
executed 3 times by 1 test: return (1);
Executed by:
  • Self test
3
315 break;
never executed: break;
0
316 case
executed 4 times by 1 test: case '#':
Executed by:
  • Self test
'#':
executed 4 times by 1 test: case '#':
Executed by:
  • Self test
4
317 if (s == string
s == stringDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
)
1-3
318 return
executed 1 time by 1 test: return (1);
Executed by:
  • Self test
(1);
executed 1 time by 1 test: return (1);
Executed by:
  • Self test
1
319-
320 default
executed 5542 times by 1 test: default:
Executed by:
  • Self test
:
executed 5542 times by 1 test: default:
Executed by:
  • Self test
code before this statement executed 3 times by 1 test: default:
Executed by:
  • Self test
3-5542
321 break;
executed 5542 times by 1 test: break;
Executed by:
  • Self test
5542
322 }-
323 }-
324-
325 return
executed 441 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 441 times by 1 test: return (0);
Executed by:
  • Self test
441
326}-
327-
328int-
329sh_contains_quotes (string)-
330 const char *string;-
331{-
332 const char *s;-
333-
334 for (s = string; s
sDescription
TRUEnever evaluated
FALSEnever evaluated
&& *
*sDescription
TRUEnever evaluated
FALSEnever evaluated
s
*sDescription
TRUEnever evaluated
FALSEnever evaluated
; s++)
0
335 {-
336 if (*
*s == '\''Description
TRUEnever evaluated
FALSEnever evaluated
s == '\''
*s == '\''Description
TRUEnever evaluated
FALSEnever evaluated
|| *
*s == '"'Description
TRUEnever evaluated
FALSEnever evaluated
s == '"'
*s == '"'Description
TRUEnever evaluated
FALSEnever evaluated
|| *
*s == '\\'Description
TRUEnever evaluated
FALSEnever evaluated
s == '\\'
*s == '\\'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
337 return
never executed: return 1;
1;
never executed: return 1;
0
338 }
never executed: end of block
0
339 return
never executed: return 0;
0;
never executed: return 0;
0
340}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2