url.h icon indicating copy to clipboard operation
url.h copied to clipboard

url_get_pathname crashing

Open stephenmathieson opened this issue 11 years ago • 3 comments

[ pretend i wrote a useful, very verbose description here ]

foo.c


#include <stdio.h>
#include "url.h"

int main() {
  char *url = "https://github.com/jwerle/url.h";
  printf("url: '%s'\n", url);

  char *repo = url_get_pathname(url);
  printf("repo: '%s'\n", repo);
  return 0;
}

then:

$ make foo
$ ./foo
url: 'https://github.com/jwerle/url.h'
Abort trap: 6
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

any ideas?

stephenmathieson avatar Dec 04 '13 15:12 stephenmathieson

Yeah this whole header file can be reworked.. I started https://github.com/jwerle/liburl which will provide the same api eventually.

jwerle avatar Dec 04 '13 16:12 jwerle

It no longer crashes but gives the wrong pathname "/".

RokerHRO avatar Jun 20 '23 17:06 RokerHRO

It no longer crashes but gives the wrong pathname "/".

lets open an issue?

jwerle avatar Jun 28 '23 09:06 jwerle