diff --git a/Makefile b/Makefile index 9429e18..b73a6c9 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,10 @@ all: cd unixfs; make all; cd main; make all; cd routing; make all; + cd dnslink; make all; + cd namesys; make all; + cd path; make all; + cd util; make all; cd test; make all; clean: @@ -40,6 +44,10 @@ clean: cd unixfs; make clean; cd main; make clean; cd routing; make clean; + cd dnslink; make clean; + cd namesys; make clean; + cd path; make clean; + cd util; make clean; cd test; make clean; rebuild: clean all diff --git a/path/path.c b/path/path.c index 1f85a83..a3062b1 100644 --- a/path/path.c +++ b/path/path.c @@ -3,11 +3,13 @@ #include #include +#include + // FromCid safely converts a cid.Cid type to a Path type char* ipfs_path_from_cid (struct Cid *c) { const char prefix[] = "/ipfs/"; - char *rpath, *cidstr;// = CidString(c); + char *rpath, *cidstr = (char*)c->hash; int l; l = sizeof(prefix) + strlen(cidstr); @@ -189,7 +191,7 @@ int ipfs_path_pop_last_segment (char **str, char *p) *str = strrchr(p, '/'); if (!*str) return ErrBadPath; // error **str = '\0'; - *str++; + (*str)++; return 0; } @@ -219,7 +221,7 @@ char *ipfs_path_from_segments(char *prefix, char **seg) int ipfs_path_parse_from_cid (char *dst, char *txt) { - struct Cid *c; + struct Cid *c = NULL; char *r; if (!txt || txt[0] == '\0') return ErrNoComponents;