X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=20f2dae0bd6efe28c2ca3b70da43ba0929f9063f;hp=33287524f51d7b7aeb0b533f012cd60423b1469d;hb=e38f07e9fae685c92366a0492f234c5576abdd63;hpb=8c250d8758df3a8a4a5c6aafb63fe198bb21fe22 diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 33287524..20f2dae0 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1146,10 +1146,11 @@ init_domain_name(struct ctf_trace *td) char *start, *end; start = td->path + strlen(td->collection_path); - start++; /* skip / */ + while (start[0] == '/') + start++; /* skip / */ end = strchr(start, '/'); if (!end) - return; + end = start + strlen(start); memcpy(td->domain, start, end - start); td->domain[end - start] = '\0'; } @@ -1164,11 +1165,13 @@ init_proc_name(struct ctf_trace *td) return; memcpy(buf, td->path, PATH_MAX); start = buf + strlen(td->collection_path); - start++; /* skip / */ + while (start[0] == '/') + start++; /* skip / */ start = strchr(start, '/'); /* get begin of domain content */ if (!start) return; - start++; /* skip / */ + while (start[0] == '/') + start++; /* skip / */ /* find last -, skips time */ end = strrchr(start, '-'); if (!end) @@ -1199,11 +1202,13 @@ init_vpid(struct ctf_trace *td) return; memcpy(buf, td->path, PATH_MAX); start = buf + strlen(td->collection_path); - start++; /* skip / */ + while (start[0] == '/') + start++; /* skip / */ start = strchr(start, '/'); /* get begin of domain content */ if (!start) return; - start++; /* skip / */ + while (start[0] == '/') + start++; /* skip / */ /* find last -, skips time */ end = strrchr(start, '-'); if (!end)