From: Holger Schemel Date: Sat, 9 Apr 2022 09:06:46 +0000 (+0200) Subject: added function to check if string is URL (not used yet) X-Git-Tag: 4.3.2.0~31 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=110edc5fe9017a947274eb64af47ebb52a12d92f;p=rocksndiamonds.git added function to check if string is URL (not used yet) --- diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 05599b77..54e5bfd1 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1298,6 +1298,14 @@ boolean strSuffixLower(char *s, char *suffix) return match; } +boolean isURL(char *s) +{ + while (*s && *s >= 'a' && *s <= 'z') + s++; + + return strPrefix(s, "://"); +} + // ---------------------------------------------------------------------------- // command line option handling functions diff --git a/src/libgame/misc.h b/src/libgame/misc.h index 6c53d318..38e4edfa 100644 --- a/src/libgame/misc.h +++ b/src/libgame/misc.h @@ -188,6 +188,7 @@ boolean strPrefix(char *, char *); boolean strSuffix(char *, char *); boolean strPrefixLower(char *, char *); boolean strSuffixLower(char *, char *); +boolean isURL(char *); void GetOptions(int, char **, void (*print_usage_function)(void),