X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=devices%2Fudev-helper.c;h=da12129316142814462162674d4e7aabdd69513f;hp=c113e55432177217c7fc144ded1b9e4ddc11ce69;hb=f6de8493cf6645f8da027671f935cf22f8008a1b;hpb=44722ec66794900881347462b6b6f32e430159af diff --git a/devices/udev-helper.c b/devices/udev-helper.c index c113e55..da12129 100644 --- a/devices/udev-helper.c +++ b/devices/udev-helper.c @@ -568,3 +568,19 @@ int main(int argc, char **argv) } return rc; } + +/* convenience function for parsers */ +char *join_paths(const char *a, const char *b) +{ + char *full_path; + + full_path = malloc(strlen(a) + strlen(b) + 2); + + strcpy(full_path, a); + if (b[0] != '/') + strcat(full_path, "/"); + strcat(full_path, b); + + return full_path; +} +