Lines Matching refs:ans

293         _cleanup_free_ char *ans = NULL;  in cunescape_length_with_prefix()  local
306 ans = new(char, pl+length+1); in cunescape_length_with_prefix()
307 if (!ans) in cunescape_length_with_prefix()
311 memcpy(ans, prefix, pl); in cunescape_length_with_prefix()
313 for (f = s, t = ans + pl; f < s + length; f++) { in cunescape_length_with_prefix()
359 assert(t >= ans); /* Let static analyzers know that the answer is non-negative. */ in cunescape_length_with_prefix()
360 *ret = TAKE_PTR(ans); in cunescape_length_with_prefix()
365 char *ans, *t, *prev, *prev2; in xescape_full() local
378 ans = new(char, MIN(strlen(s), console_width) * 4 + 1); in xescape_full()
379 if (!ans) in xescape_full()
382 memset(ans, '_', MIN(strlen(s), console_width) * 4); in xescape_full()
383 ans[MIN(strlen(s), console_width) * 4] = 0; in xescape_full()
387 for (f = s, t = prev = prev2 = ans; ; f++) { in xescape_full()
395 return ans; in xescape_full()
401 if ((size_t) (t - ans) + 4 + 3 * force_ellipsis > console_width) in xescape_full()
409 if ((size_t) (t - ans) + 1 + 3 * force_ellipsis > console_width) in xescape_full()
423 if (console_width - c >= (size_t) (t - ans)) in xescape_full()
424 off = (size_t) (t - ans); in xescape_full()
425 else if (console_width - c >= (size_t) (prev - ans)) in xescape_full()
426 off = (size_t) (prev - ans); in xescape_full()
427 else if (console_width - c >= (size_t) (prev2 - ans)) in xescape_full()
428 off = (size_t) (prev2 - ans); in xescape_full()
431 assert(off <= (size_t) (t - ans)); in xescape_full()
433 memcpy(ans + off, "...", c); in xescape_full()
434 ans[off + c] = '\0'; in xescape_full()
435 return ans; in xescape_full()