看板 DFBSD_bugs 關於我們 聯絡資訊
This is a multi-part message in MIME format. --------------080605060300090602050705 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > > Anyway, (attempt at a) patch below. I think I made a bit of a mess of > the whole strlen stuff maybe. Not too sure about that.. > > Thanks > Sorry, would have been better to attach the patch as a file I think, to preserve tabs and such. Whoops. I'll get there in the end! See attached. -- Internet Explorer? Try FireFox at http://www.mozilla.org/products/firefox/ Outlook Express? Try ThunderBird at http://www.mozilla.org/products/thunderbird/ --------------080605060300090602050705 Content-Type: text/plain; name="hunt.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hunt.c.diff" --- hunt.c.old 2004-10-27 16:44:06.000000000 +0100 +++ hunt.c 2004-10-27 17:12:57.000000000 +0100 @@ -58,17 +58,31 @@ hunt(name) char *name; { - register char *cp; + register char *cp, *tmp_cp; sig_t f; - int res; + int res, cp_len = 0; f = signal(SIGALRM, dead); while ((cp = getremote(name))) { deadfl = 0; - if ((uucplock = strrchr(cp, '/')) == NULL) - uucplock = cp; - else + + cp_len = strlen(cp) + strlen("/dev/") + 1; + tmp_cp = malloc(sizeof(char) * cp_len); + + if ((uucplock = strrchr(cp, '/')) == NULL) { + strncpy(tmp_cp, "/dev/", 6); + strncat(tmp_cp, cp, strlen(cp)); + cp = tmp_cp; + + if ((uucplock = strrchr(cp, '/')) == NULL) { + uucplock = cp; + } else { + ++uucplock; + } + } else { ++uucplock; + } + if ((res = uu_lock(uucplock)) != UU_LOCK_OK) { if (res != UU_LOCK_INUSE) fprintf(stderr, "uu_lock: %s\n", uu_lockerr(res)); --------------080605060300090602050705--