one field in /etc/ttys may be quoted (from entropy!hubert@uw-beaver)
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Sat, 2 Nov 1985 06:06:10 +0000 (22:06 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Sat, 2 Nov 1985 06:06:10 +0000 (22:06 -0800)
SCCS-vsn: usr.bin/uucp/acucntrl/acucntrl.c 5.6

usr/src/usr.bin/uucp/acucntrl/acucntrl.c

index 6d6592b..2dea231 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)acucntrl.c 5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)acucntrl.c 5.6 (Berkeley) %G%";
 #endif
 
 /*  acucntrl - turn around tty line between dialin and dialout
 #endif
 
 /*  acucntrl - turn around tty line between dialin and dialout
@@ -452,10 +452,19 @@ int enable;
        }
        /* format is now */
        /* ttyd0 std.100 dialup on secure # comment */
        }
        /* format is now */
        /* ttyd0 std.100 dialup on secure # comment */
+       /* except, 2nd item may have embedded spaces inside quotes, Hubert */
        cp = lbuf;
        for (i=0;*cp && i<3;i++) {
        cp = lbuf;
        for (i=0;*cp && i<3;i++) {
-               while (*cp && *cp != ' ' && *cp != '\t')
+               if (*cp == '"') {
                        cp++;
                        cp++;
+                       while (*cp && *cp != '"')
+                               cp++;
+                       if (*cp != '\0')
+                               cp++;
+               }else {
+                       while (*cp && *cp != ' ' && *cp != '\t')
+                               cp++;
+               }
                while (*cp && (*cp == ' ' || *cp == '\t'))
                        cp++;
        }
                while (*cp && (*cp == ' ' || *cp == '\t'))
                        cp++;
        }