From: Paul Mackerras Date: Sun, 24 Oct 2004 23:53:05 +0000 (+0000) Subject: Don't prepend /dev/ to a possible device name if it already begins X-Git-Tag: ppp-2.4.7~231 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=a81af2d7cf2d6a53b37798311f47f71951e47345 Don't prepend /dev/ to a possible device name if it already begins with '/' (i.e. just check for / instead of /dev/ as before). This allows /udev/blah to be used as a tty device name. Requested by Pawel Sakowski. --- diff --git a/pppd/tty.c b/pppd/tty.c index dbfc67e..d39d4a4 100644 --- a/pppd/tty.c +++ b/pppd/tty.c @@ -73,7 +73,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: tty.c,v 1.14 2004/01/17 05:47:55 carlsonj Exp $" +#define RCSID "$Id: tty.c,v 1.15 2004/10/24 23:53:05 paulus Exp $" #include #include @@ -300,7 +300,7 @@ setdevname(cp, argv, doit) if (*cp == 0) return 0; - if (strncmp("/dev/", cp, 5) != 0) { + if (*cp != '/') { strlcpy(dev, "/dev/", sizeof(dev)); strlcat(dev, cp, sizeof(dev)); cp = dev;