=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/m4/eval.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** src/usr.bin/m4/eval.c 1995/10/18 08:45:35 1.1 --- src/usr.bin/m4/eval.c 1996/01/15 01:12:11 1.2 *************** *** 1,4 **** ! /* $NetBSD: eval.c,v 1.4 1995/09/28 05:37:28 tls Exp $ */ /* * Copyright (c) 1989, 1993 --- 1,4 ---- ! /* $NetBSD: eval.c,v 1.5 1996/01/13 23:25:23 pk Exp $ */ /* * Copyright (c) 1989, 1993 *************** *** 40,46 **** #if 0 static char sccsid[] = "@(#)eval.c 8.2 (Berkeley) 4/27/95"; #else ! static char rcsid[] = "$NetBSD: eval.c,v 1.4 1995/09/28 05:37:28 tls Exp $"; #endif #endif /* not lint */ --- 40,46 ---- #if 0 static char sccsid[] = "@(#)eval.c 8.2 (Berkeley) 4/27/95"; #else ! static char rcsid[] = "$NetBSD: eval.c,v 1.5 1996/01/13 23:25:23 pk Exp $"; #endif #endif /* not lint */ *************** *** 236,250 **** * argv[2]) */ if (argc > 3) { for (n = argc - 1; n > 3; n--) { ! putback(rquote); pbstr(argv[n]); ! putback(lquote); putback(','); } ! putback(rquote); pbstr(argv[3]); ! putback(lquote); } break; --- 236,259 ---- * argv[2]) */ if (argc > 3) { + int k; for (n = argc - 1; n > 3; n--) { ! k = strlen(rquote); ! while (k--) ! putback(rquote[k]); pbstr(argv[n]); ! k = strlen(lquote); ! while (k--) ! putback(lquote[k]); putback(','); } ! k = strlen(rquote); ! while (k--) ! putback(rquote[k]); pbstr(argv[3]); ! k = strlen(lquote); ! while (k--) ! putback(lquote[k]); } break; *************** *** 473,481 **** register ndptr p; if ((p = lookup(name)) != nil && p->defn != null) { ! putback(rquote); pbstr(p->defn); ! putback(lquote); } } --- 482,494 ---- register ndptr p; if ((p = lookup(name)) != nil && p->defn != null) { ! int n = strlen(rquote); ! while (n--) ! putback(rquote[n]); pbstr(p->defn); ! n = strlen(lquote); ! while (n--) ! putback(lquote[n]); } } *************** *** 605,621 **** { if (argc > 2) { if (*argv[2]) ! lquote = *argv[2]; if (argc > 3) { if (*argv[3]) ! rquote = *argv[3]; } else ! rquote = lquote; } else { ! lquote = LQUOTE; ! rquote = RQUOTE; } } --- 618,634 ---- { if (argc > 2) { if (*argv[2]) ! strncpy(lquote, argv[2], MAXCCHARS); if (argc > 3) { if (*argv[3]) ! strncpy(rquote, argv[3], MAXCCHARS); } else ! strcpy(rquote, lquote); } else { ! lquote[0] = LQUOTE, lquote[1] = '\0'; ! rquote[0] = RQUOTE, rquote[1] = '\0'; } } *************** *** 629,645 **** { if (argc > 2) { if (*argv[2]) ! scommt = *argv[2]; if (argc > 3) { if (*argv[3]) ! ecommt = *argv[3]; } else ! ecommt = ECOMMT; } else { ! scommt = SCOMMT; ! ecommt = ECOMMT; } } --- 642,658 ---- { if (argc > 2) { if (*argv[2]) ! strncpy(scommt, argv[2], MAXCCHARS); if (argc > 3) { if (*argv[3]) ! strncpy(ecommt, argv[3], MAXCCHARS); } else ! ecommt[0] = ECOMMT, ecommt[1] = '\0'; } else { ! scommt[0] = SCOMMT, scommt[1] = '\0'; ! ecommt[0] = ECOMMT, ecommt[1] = '\0'; } }