MCPcopy Create free account
hub / github.com/apache/httpd / strcmplex

Function strcmplex

server/util_expr_eval.c:323–344  ·  view source on GitHub ↗

combined string/int comparison for compatibility with ssl_expr */

Source from the content-addressed store, hash-verified

321
322/* combined string/int comparison for compatibility with ssl_expr */
323static int strcmplex(const char *str1, const char *str2)
324{
325 apr_size_t i, n1, n2;
326
327 if (str1 == NULL)
328 return -1;
329 if (str2 == NULL)
330 return +1;
331 n1 = strlen(str1);
332 n2 = strlen(str2);
333 if (n1 > n2)
334 return 1;
335 if (n1 < n2)
336 return -1;
337 for (i = 0; i < n1; i++) {
338 if (str1[i] > str2[i])
339 return 1;
340 if (str1[i] < str2[i])
341 return -1;
342 }
343 return 0;
344}
345
346static int ssl_expr_eval_comp(ap_expr_eval_ctx_t *ctx, const ap_expr_t *node)
347{

Callers 1

ssl_expr_eval_compFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected