diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/nsurl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/nsurl.c b/utils/nsurl.c index ae0c4829b..c99b0d34a 100644 --- a/utils/nsurl.c +++ b/utils/nsurl.c @@ -1911,6 +1911,15 @@ nserror nsurl_defragment(const nsurl *url, nsurl **no_frag) size_t length; char *pos; + /* check for source url having no fragment already */ + if (url->components.fragment == NULL) { + *no_frag = (nsurl *)url; + + (*no_frag)->count++; + + return NSERROR_OK; + } + /* Find the change in length from url to new_url */ length = url->length; if (url->components.fragment != NULL) { |