gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, extgawk, updated. 207fc1458c7f168822e454


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, extgawk, updated. 207fc1458c7f168822e454a89f23428c64163427
Date: Fri, 27 Jul 2012 13:35:06 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, extgawk has been updated
       via  207fc1458c7f168822e454a89f23428c64163427 (commit)
      from  0544971abd3bf6eda1531e62b4a19e221a68a6e5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=207fc1458c7f168822e454a89f23428c64163427

commit 207fc1458c7f168822e454a89f23428c64163427
Author: Arnold D. Robbins <address@hidden>
Date:   Fri Jul 27 15:25:05 2012 +0300

    Fix bug in API set_RT, bug in readdir.c.

diff --git a/ChangeLog b/ChangeLog
index 44de58f..d91717e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-07-27         Arnold D. Robbins     <address@hidden>
+
+       * awk.h (set_RT): Change to take a NODE * parameter.
+       * io.c (set_RT): Change to take a NODE * parameter.
+       * gawkapi.h: Change open hook to input parser in comment.
+       * gawkapi.c (api_set_RT): Adjust call to set_RT.
+
 2012-07-26         Arnold D. Robbins     <address@hidden>
 
        * awk.h (set_RT_to_null, set_RT): Declare functions.
diff --git a/awk.h b/awk.h
index 3b7129f..afc18e2 100644
--- a/awk.h
+++ b/awk.h
@@ -1546,7 +1546,7 @@ extern void register_input_parser(awk_input_parser_t 
*input_parser);
 extern void set_FNR(void);
 extern void set_NR(void);
 extern void set_RT_to_null(void);
-extern void set_RT(const char *str, size_t len);
+extern void set_RT(NODE *n);
 
 extern struct redirect *redirect(NODE *redir_exp, int redirtype, int *errflg);
 extern NODE *do_close(int nargs);
diff --git a/extension/ChangeLog b/extension/ChangeLog
index ae0df1a..5e39135 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-27         Arnold D. Robbins     <address@hidden>
+
+       * readdir.c (dir_take_control_of): Fix typo for case where
+       we don't have fopendir (e.g., Mac OS X 10.5).
+
 2012-07-26         Arnold D. Robbins     <address@hidden>
 
        * configure.ac: Extremely crude hack to get the value of
diff --git a/extension/readdir.c b/extension/readdir.c
index f2a1602..c2b6cbd 100644
--- a/extension/readdir.c
+++ b/extension/readdir.c
@@ -208,7 +208,7 @@ dir_take_control_of(IOBUF_PUBLIC *iobuf)
 #ifdef HAVE_FDOPENDIR
        dp = fdopendir(iobuf->fd);
 #else
-       dp = opendir(iob->name);
+       dp = opendir(iobuf->name);
        if (dp != NULL)
                iobuf->fd = dirfd(dp);
 #endif
diff --git a/gawkapi.c b/gawkapi.c
index a2128fe..39e85e5 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -252,8 +252,7 @@ api_set_RT(awk_ext_id_t id, awk_value_t *value)
        case AWK_SCALAR:
                n = awk_value_to_node(value);
                force_string(n);
-               set_RT(n->stptr, n->stlen);
-               freenode(n);
+               set_RT(n);      /* set_RT takes ownership of n */
        }
 }
 
diff --git a/gawkapi.h b/gawkapi.h
index db650fb..0204053 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -80,7 +80,7 @@ extern "C" {
 typedef struct iobuf_public {
        const char *name;       /* filename */
        int fd;                 /* file descriptor */
-       void *opaque;           /* private data for open hooks */
+       void *opaque;           /* private data for input parsers */
        /*
         * The get_record function is called to read the next record of data.
         * It should return the length of the input record (or EOF), and
diff --git a/io.c b/io.c
index f4ea286..2f3c5f8 100644
--- a/io.c
+++ b/io.c
@@ -332,7 +332,7 @@ after_beginfile(IOBUF **curfile)
        }
 
        /*
-        * Open hooks could have been changed by BEGINFILE,
+        * Input parsers could have been changed by BEGINFILE,
         * so delay check until now.
         */
 
@@ -2678,14 +2678,18 @@ set_RT_to_null()
        }
 }
 
-/* set_RT --- real function for use by extension API */
+/* set_RT --- real function **** for use by extension API **** */
 
 void
-set_RT(const char *str, size_t len)
+set_RT(NODE *n)
 {
-       if (! do_traditional) {
+       if (do_traditional)
+               unref(n);
+       else if (RT_node->var_value == n)
+               assert(n == Nnull_string);      /* do nothing */
+       else {
                unref(RT_node->var_value);
-               RT_node->var_value = make_str_node(str, len, ALREADY_MALLOCED);
+               RT_node->var_value = n;
        }
 }
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |    7 +++++++
 awk.h               |    2 +-
 extension/ChangeLog |    5 +++++
 extension/readdir.c |    2 +-
 gawkapi.c           |    3 +--
 gawkapi.h           |    2 +-
 io.c                |   14 +++++++++-----
 7 files changed, 25 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]