tmacro was broke.
authorjbj <devnull@localhost>
Mon, 16 Aug 1999 20:14:34 +0000 (20:14 +0000)
committerjbj <devnull@localhost>
Mon, 16 Aug 1999 20:14:34 +0000 (20:14 +0000)
CVS patchset: 3231
CVS date: 1999/08/16 20:14:34

lib/macro.c
rpmio/macro.c

index 602b03b..46cccb4 100644 (file)
@@ -1519,8 +1519,7 @@ main(int argc, char *argv[])
        dumpMacroTable(NULL, NULL);
 
        if ((fp = fopen(testfile, "r")) != NULL) {
-               while(fgets(buf, sizeof(buf), fp)) {
-                       buf[strlen(buf)-1] = '\0';
+               while(rdcl(buf, sizeof(buf), fp, 1)) {
                        x = expandMacros(NULL, NULL, buf, sizeof(buf));
                        fprintf(stderr, "%d->%s\n", x, buf);
                        memset(buf, 0, sizeof(buf));
@@ -1529,7 +1528,6 @@ main(int argc, char *argv[])
        }
 
        while(rdcl(buf, sizeof(buf), stdin, 1)) {
-               buf[strlen(buf)-1] = '\0';
                x = expandMacros(NULL, NULL, buf, sizeof(buf));
                fprintf(stderr, "%d->%s\n <-\n", x, buf);
                memset(buf, 0, sizeof(buf));
index 602b03b..46cccb4 100644 (file)
@@ -1519,8 +1519,7 @@ main(int argc, char *argv[])
        dumpMacroTable(NULL, NULL);
 
        if ((fp = fopen(testfile, "r")) != NULL) {
-               while(fgets(buf, sizeof(buf), fp)) {
-                       buf[strlen(buf)-1] = '\0';
+               while(rdcl(buf, sizeof(buf), fp, 1)) {
                        x = expandMacros(NULL, NULL, buf, sizeof(buf));
                        fprintf(stderr, "%d->%s\n", x, buf);
                        memset(buf, 0, sizeof(buf));
@@ -1529,7 +1528,6 @@ main(int argc, char *argv[])
        }
 
        while(rdcl(buf, sizeof(buf), stdin, 1)) {
-               buf[strlen(buf)-1] = '\0';
                x = expandMacros(NULL, NULL, buf, sizeof(buf));
                fprintf(stderr, "%d->%s\n <-\n", x, buf);
                memset(buf, 0, sizeof(buf));