Date: Thu, 2 Nov 2000 14:04:18 -0800 (PST) From: Jon Simola <jon@abccom.bc.ca> To: freebsd-ports@freebsd.org Subject: ports/converters/fconv fix Message-ID: <Pine.BSF.3.96.1001102135918.20170K-100000@newmail.netbistro.com>
next in thread | raw e-mail | index | archive | help
Note: I've already sent this to chris@FreeBSD.org, the listed maintainer, but I'm curious about feedback on this as there's a couple other little bugs I'm looking to fix. I was having a problem with fconv and calling it using a path with multiple slashes. IE, running ./mac2bsd file.in file.out or, if mac2bsd was in the path mac2bsd file.in file.out Would work fine, but /usr/local/bin/mac2bsd file.in file.out would just open the input and output files, but then die parsing the multiple slashes in arg[0] while figuring out what program it was being run as (and what to do from there). This patch fixes that. Sorry if I went through the wrong channels to submit this, I figured filing a PR would be a bit much for such a simple fix. *** fconv.c.orig Mon May 3 12:09:54 1999 --- fconv.c Wed Nov 1 23:37:45 2000 *************** *** 114,124 **** } /* Now determine the program to use */ ! tprg = strchr(prg, '/'); ! ! if (tprg != NULL) ! if ((tprg += 1) != NULL) prg = tprg; TEST(dos2bsd, bsd2dos, mac2bsd, bsd2mac); if (mode == -1) --- 114,126 ---- } /* Now determine the program to use */ ! tprg = prg; ! do { ! if (*tprg == '/') prg = tprg; + tprg++; + } while (*tprg != '\0'); + prg++; TEST(dos2bsd, bsd2dos, mac2bsd, bsd2mac); if (mode == -1) --- Jon Simola <jon@abccom.bc.ca> | "In the near future - corporate networks Systems Administrator | reach out to the stars, electrons and light ABC Communications | flow throughout the universe." -- GITS To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.1001102135918.20170K-100000>