1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-03 20:34:14 +01:00

WINGs: Add wshellquote()

Transforms its argument so that the result is safe to pass to the shell
as an argument.

With very heavy inspirations from NetBSD's shquote(3),
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/gen/shquote.c?annotate
http://man.netbsd.org/cgi-bin/man-cgi?shquote

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
This commit is contained in:
Tamas TEVESZ
2010-10-12 18:38:45 +02:00
committed by Carlos R. Mafra
parent 3f8bba8064
commit b5ed9841bc
2 changed files with 72 additions and 0 deletions

View File

@@ -243,6 +243,12 @@ void wtokenfree(char **tokens, int count);
char* wtrimspace(const char *s);
/* transform `s' so that the result is safe to pass to the shell as an argument.
* returns a newly allocated string.
* with very heavy inspirations from NetBSD's shquote(3).
*/
char *wshellquote(const char *s);
/* ---[ WINGs/wmisc.c ]--------------------------------------------------- */
WMRange wmkrange(int start, int count);