diff --git a/basename.c b/basename.c index 30c4aac..2a1d225 100644 --- a/basename.c +++ b/basename.c @@ -20,7 +20,7 @@ e_basename(const char *string, const int size, void *context) char *ret; char *base = (char*)context; - if ( base && string && string[0] == '/' && (ret=malloc(strlen(base)+size+2)) ) { + if ( base && string && (string[0] == '/') && (ret=malloc(strlen(base)+size+2)) ) { strcpy(ret, base); strncat(ret, string, size); return ret; diff --git a/tests/e_url.t b/tests/e_url.t new file mode 100644 index 0000000..9cd7613 --- /dev/null +++ b/tests/e_url.t @@ -0,0 +1,13 @@ +. tests/functions.sh + +title "mkd_basename (e_url)" + +rc=0 +MARKDOWN_FLAGS= + +try -bHOHO 'empty []() with baseurl' '[]()' '

' +try -bHOHO '[]() with full url' '[](http://foo)' '

' +try -bHOHO '[]() with url fragment' '[](/foo)' '

' + +summary $0 +exit $rc