mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-08 19:22:39 +02:00
commit bash-20140912 snapshot
This commit is contained in:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user