commit bash-20140912 snapshot

This commit is contained in:
Chet Ramey
2014-10-02 10:21:23 -04:00
parent e198129d21
commit 96f3fb6664
25 changed files with 12096 additions and 822 deletions
+21
View File
@@ -777,6 +777,27 @@ trim_pathname (name, maxlen)
return name;
}
/* Return a printable representation of FN without special characters. The
caller is responsible for freeing memory if this returns something other
than its argument. If FLAGS is non-zero, we are printing for portable
re-input and should single-quote filenames appropriately. */
char *
printable_filename (fn, flags)
char *fn;
int flags;
{
char *newf;
if (ansic_shouldquote (fn))
newf = ansic_quote (fn, 0, NULL);
else if (flags && sh_contains_shell_metas (fn))
newf = sh_single_quote (fn);
else
newf = fn;
return newf;
}
/* Given a string containing units of information separated by colons,
return the next one pointed to by (P_INDEX), or NULL if there are no more.
Advance (P_INDEX) to the character after the colon. */