Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforge.net>2009-11-19 05:34:35 +0300
committerJustin Maggard <jmaggard@users.sourceforge.net>2009-11-19 05:34:35 +0300
commit2d389db63b6c8878d174e1a2bf0960bedaa47f80 (patch)
tree072d7fcef6e3f0e2ac356e5a8991b6bbf9d5985c /utils.c
parente2c7226ee782be807ff77990b5ca9f55651baee2 (diff)
* Make UPnPSearch using the "contains" keyword work properly with substring searches.
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/utils.c b/utils.c
index 879d9bf..c199d19 100644
--- a/utils.c
+++ b/utils.c
@@ -89,7 +89,7 @@ modifyString(char * string, const char * before, const char * after, short like)
oldlen = strlen(before);
newlen = strlen(after);
- if( newlen > oldlen )
+ if( newlen+like > oldlen )
{
s = string;
while( (p = strstr(s, before)) )
@@ -114,10 +114,17 @@ modifyString(char * string, const char * before, const char * after, short like)
while( isspace(*t) )
t++;
if( *t == '"' )
+ {
+ if( like == 2 )
+ {
+ memmove(t+2, t+1, strlen(t+1)+1);
+ *++t = '*';
+ }
while( *++t != '"' )
continue;
- memmove(t+1, t, strlen(t)+1);
- *t = '*';
+ memmove(t+1, t, strlen(t)+1);
+ *t = '*';
+ }
}
s = p + newlen;
}