ls: make the static array "const"

This commit is contained in:
Max Kellermann 2014-12-09 22:01:15 +01:00
parent e813c93e08
commit b70df57f7b

View File

@ -30,7 +30,7 @@
* is detected at runtime and displayed as a urlhandler if the client is * is detected at runtime and displayed as a urlhandler if the client is
* connected by IPC socket. * connected by IPC socket.
*/ */
static const char *remoteUrlPrefixes[] = { static const char *const remoteUrlPrefixes[] = {
#if defined(ENABLE_CURL) #if defined(ENABLE_CURL)
"http://", "http://",
"https://", "https://",
@ -69,7 +69,7 @@ static const char *remoteUrlPrefixes[] = {
void print_supported_uri_schemes_to_fp(FILE *fp) void print_supported_uri_schemes_to_fp(FILE *fp)
{ {
const char **prefixes = remoteUrlPrefixes; const char *const*prefixes = remoteUrlPrefixes;
#ifdef HAVE_UN #ifdef HAVE_UN
fprintf(fp, " file://"); fprintf(fp, " file://");
@ -83,7 +83,7 @@ void print_supported_uri_schemes_to_fp(FILE *fp)
void print_supported_uri_schemes(Client &client) void print_supported_uri_schemes(Client &client)
{ {
const char **prefixes = remoteUrlPrefixes; const char *const *prefixes = remoteUrlPrefixes;
while (*prefixes) { while (*prefixes) {
client_printf(client, "handler: %s\n", *prefixes); client_printf(client, "handler: %s\n", *prefixes);
@ -93,7 +93,7 @@ void print_supported_uri_schemes(Client &client)
bool uri_supported_scheme(const char *uri) bool uri_supported_scheme(const char *uri)
{ {
const char **urlPrefixes = remoteUrlPrefixes; const char *const*urlPrefixes = remoteUrlPrefixes;
assert(uri_has_scheme(uri)); assert(uri_has_scheme(uri));