Commit d0024c07 authored by Max Kellermann's avatar Max Kellermann

ls: use bool

Use the C99 "bool" data type instead of "int".
parent 1d82edc6
...@@ -42,19 +42,18 @@ void printRemoteUrlHandlers(struct client *client) ...@@ -42,19 +42,18 @@ void printRemoteUrlHandlers(struct client *client)
} }
} }
int isRemoteUrl(const char *url)
bool isRemoteUrl(const char *url)
{ {
int count = 0;
const char **urlPrefixes = remoteUrlPrefixes; const char **urlPrefixes = remoteUrlPrefixes;
while (*urlPrefixes) { while (*urlPrefixes) {
count++;
if (g_str_has_prefix(url, *urlPrefixes)) if (g_str_has_prefix(url, *urlPrefixes))
return count; return true;
urlPrefixes++; urlPrefixes++;
} }
return 0; return false;
} }
/* suffixes should be ascii only characters */ /* suffixes should be ascii only characters */
......
...@@ -21,12 +21,14 @@ ...@@ -21,12 +21,14 @@
#include "decoder_list.h" #include "decoder_list.h"
#include <stdbool.h>
struct stat; struct stat;
struct client; struct client;
const char *getSuffix(const char *utf8file); const char *getSuffix(const char *utf8file);
int isRemoteUrl(const char *url); bool isRemoteUrl(const char *url);
const struct decoder_plugin * const struct decoder_plugin *
hasMusicSuffix(const char *utf8file, unsigned int next); hasMusicSuffix(const char *utf8file, unsigned int next);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment