mirror of
https://github.com/mirror/wget.git
synced 2025-02-02 07:40:15 +08:00
[svn] Update escnonprint documentation.
This commit is contained in:
parent
01f3d4b33c
commit
7628e1582e
18
src/log.c
18
src/log.c
@ -744,6 +744,18 @@ escnonprint_internal (const char *str, char escape, int base)
|
|||||||
characters in STR, STR is returned. See copy_and_escape for more
|
characters in STR, STR is returned. See copy_and_escape for more
|
||||||
information on which characters are considered non-printable.
|
information on which characters are considered non-printable.
|
||||||
|
|
||||||
|
DON'T call this function on translated strings because escaping
|
||||||
|
will break them. Don't call it on literal strings from the source,
|
||||||
|
which are by definition trusted. If newlines are allowed in the
|
||||||
|
string, escape and print it line by line because escaping the whole
|
||||||
|
string will convert newlines to \012. (This is so that expectedly
|
||||||
|
single-line messages cannot use embedded newlines to mimic Wget's
|
||||||
|
output and deceive the user.)
|
||||||
|
|
||||||
|
escnonprint doesn't quote its escape character because it is notf
|
||||||
|
meant as a general and reversible quoting mechanism, but as a quick
|
||||||
|
way to defang binary junk sent by malicious or buggy servers.
|
||||||
|
|
||||||
NOTE: since this function can return a pointer to static data, be
|
NOTE: since this function can return a pointer to static data, be
|
||||||
careful to copy its result before calling it again. However, to be
|
careful to copy its result before calling it again. However, to be
|
||||||
more useful with printf, it maintains an internal ring of static
|
more useful with printf, it maintains an internal ring of static
|
||||||
@ -759,11 +771,9 @@ escnonprint (const char *str)
|
|||||||
|
|
||||||
/* Return a pointer to a static copy of STR with the non-printable
|
/* Return a pointer to a static copy of STR with the non-printable
|
||||||
characters escaped as %XX. If there are no non-printable
|
characters escaped as %XX. If there are no non-printable
|
||||||
characters in STR, STR is returned. See copy_and_escape for more
|
characters in STR, STR is returned.
|
||||||
information on which characters are considered non-printable.
|
|
||||||
|
|
||||||
This function returns a pointer to static data which will be
|
See escnonprint for usage details. */
|
||||||
overwritten by subsequent calls -- see escnonprint for details. */
|
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
escnonprint_uri (const char *str)
|
escnonprint_uri (const char *str)
|
||||||
|
Loading…
Reference in New Issue
Block a user