[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sh-quote: Improve shell_quote_argv's signature
From: |
Bruno Haible |
Subject: |
sh-quote: Improve shell_quote_argv's signature |
Date: |
Mon, 07 May 2012 03:32:38 +0200 |
User-agent: |
KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; ) |
A trivial API change, to avoid the need for const-casts.
2012-05-06 Bruno Haible <address@hidden>
sh-quote: Improve shell_quote_argv's signature.
* lib/sh-quote.h (shell_quote_argv): Make argument array a 'const *'.
* lib/sh-quote.c (shell_quote_argv): Likewise.
--- lib/sh-quote.h.orig Mon May 7 03:31:12 2012
+++ lib/sh-quote.h Mon May 7 02:21:47 2012
@@ -33,4 +33,4 @@
/* Returns a freshly allocated string containing all argument strings, quoted,
separated through spaces. */
-extern char * shell_quote_argv (char **argv);
+extern char * shell_quote_argv (char * const *argv);
--- lib/sh-quote.c.orig Mon May 7 03:31:11 2012
+++ lib/sh-quote.c Mon May 7 03:13:19 2012
@@ -69,11 +69,11 @@
/* Returns a freshly allocated string containing all argument strings, quoted,
separated through spaces. */
char *
-shell_quote_argv (char **argv)
+shell_quote_argv (char * const *argv)
{
if (*argv != NULL)
{
- char **argp;
+ char * const *argp;
size_t length;
char *command;
char *p;
- sh-quote: Improve shell_quote_argv's signature,
Bruno Haible <=