Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Allow junk variable to work in non dynamic cont...



details:   https://anonhg.NetBSD.org/src/rev/01ef9d587bd2
branches:  trunk
changeset: 473540:01ef9d587bd2
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jun 06 20:24:02 1999 +0000

description:
Allow junk variable to work in non dynamic contexts. Allows as to say things
like:
    .if defined(COPTS) && !empty(COPTS:M*-g*)

diffstat:

 usr.bin/make/var.c |  23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diffs (85 lines):

diff -r 91f8f08bc731 -r 01ef9d587bd2 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Jun 06 20:20:46 1999 +0000
+++ b/usr.bin/make/var.c        Sun Jun 06 20:24:02 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.31 1999/04/03 04:37:47 gwr Exp $     */
+/*     $NetBSD: var.c,v 1.32 1999/06/06 20:24:02 christos Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -39,14 +39,14 @@
  */
 
 #ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: var.c,v 1.31 1999/04/03 04:37:47 gwr Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.32 1999/06/06 20:24:02 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.31 1999/04/03 04:37:47 gwr Exp $");
+__RCSID("$NetBSD: var.c,v 1.32 1999/06/06 20:24:02 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1551,6 +1551,7 @@
             * right now, setting the length to be the distance to
             * the end of the string, since that's what make does.
             */
+printf("never found end char\n");
            *lengthPtr = tstr - str;
            return (var_Error);
        }
@@ -1668,6 +1669,7 @@
                    return(str);
                } else {
                    Buf_Destroy (buf, TRUE);
+printf("no modifiers %d\n", err);
                    return (err ? var_Error : varNoError);
                }
            } else {
@@ -1930,6 +1932,7 @@
                        *lengthPtr = cp - start + 1;
                        VarREError(error, &pattern.re, "RE substitution error");
                        free(pattern.replace);
+printf("regcomp error\n");
                        return (var_Error);
                    }
 
@@ -2079,6 +2082,7 @@
                             cp++)
                                 continue;
                        termc = *cp;
+printf("Unknown modifier\n");
                        newStr = var_Error;
                    }
                }
@@ -2137,14 +2141,10 @@
        *freePtr = FALSE;
        Buf_Destroy(v->val, TRUE);
        free((Address)v);
-       if (dynamic) {
-           str = emalloc(*lengthPtr + 1);
-           strncpy(str, start, *lengthPtr);
-           str[*lengthPtr] = '\0';
-           *freePtr = TRUE;
-       } else {
-           str = var_Error;
-       }
+       str = emalloc(*lengthPtr + 1);
+       strncpy(str, start, *lengthPtr);
+       str[*lengthPtr] = '\0';
+       *freePtr = TRUE;
     }
     return (str);
 
@@ -2155,6 +2155,7 @@
     if (delim != '\0')
        Error("Unclosed substitution for %s (%c missing)",
              v->name, delim);
+printf("cleanup\n");
     return (var_Error);
 }
 



Home | Main Index | Thread Index | Old Index