You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2021/11/07 17:47:23 UTC

[incubator-nuttx] branch master updated (3847539 -> eee85fa)

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from 3847539  board: Run ./tools/refresh.sh --silent all
     new e81182d  tools/mkconfig: Handle string with escape character correctly
     new eee85fa  tools/mkconfig: Remove the redundant skip_space

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tools/cfgdefine.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

[incubator-nuttx] 02/02: tools/mkconfig: Remove the redundant skip_space

Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit eee85faab1e7a5c45a3267fcf092983066c518ca
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Nov 7 21:20:11 2021 +0800

    tools/mkconfig: Remove the redundant skip_space
    
    the same thing is already done at line 136
    and remove the redundant cast too
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 tools/cfgdefine.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/tools/cfgdefine.c b/tools/cfgdefine.c
index 0f225be..39cccac 100644
--- a/tools/cfgdefine.c
+++ b/tools/cfgdefine.c
@@ -86,7 +86,7 @@ static const char *dequote_list[] =
 
 static char *skip_space(char *ptr)
 {
-  while (*ptr && isspace((int)*ptr)) ptr++;
+  while (*ptr && isspace(*ptr)) ptr++;
   return ptr;
 }
 
@@ -94,7 +94,7 @@ static char *skip_space(char *ptr)
 
 static char *find_name_end(char *ptr)
 {
-  while (*ptr && (isalnum((int)*ptr) || *ptr == '_')) ptr++;
+  while (*ptr && (isalnum(*ptr) || *ptr == '_')) ptr++;
   return ptr;
 }
 
@@ -102,7 +102,7 @@ static char *find_name_end(char *ptr)
 
 static char *find_value_end(char *ptr)
 {
-  while (*ptr && !isspace((int)*ptr))
+  while (*ptr && !isspace(*ptr))
     {
       if (*ptr == '"')
         {
@@ -111,7 +111,7 @@ static char *find_value_end(char *ptr)
         }
       else
         {
-          do ptr++; while (*ptr && !isspace((int)*ptr) && *ptr != '"');
+          do ptr++; while (*ptr && !isspace(*ptr) && *ptr != '"');
         }
     }
 
@@ -148,13 +148,7 @@ static char *read_line(FILE *stream)
 
 static void parse_line(char *ptr, char **varname, char **varval)
 {
-  /* Skip over any leading spaces */
-
-  ptr = skip_space(ptr);
-
-  /* The first no-space is the beginning of the variable name */
-
-  *varname = skip_space(ptr);
+  *varname = ptr;
   *varval = NULL;
 
   /* Parse to the end of the variable name */

[incubator-nuttx] 01/02: tools/mkconfig: Handle string with escape character correctly

Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit e81182df14e61b5c501d5af0901f3ca0e1867d6a
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Nov 7 22:08:01 2021 +0800

    tools/mkconfig: Handle string with escape character correctly
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 tools/cfgdefine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/cfgdefine.c b/tools/cfgdefine.c
index 6a335a0..0f225be 100644
--- a/tools/cfgdefine.c
+++ b/tools/cfgdefine.c
@@ -106,7 +106,7 @@ static char *find_value_end(char *ptr)
     {
       if (*ptr == '"')
         {
-          do ptr++; while (*ptr && *ptr != '"');
+          do ptr++; while (*ptr && (*ptr != '"' || *(ptr - 1) == '\\'));
           if (*ptr) ptr++;
         }
       else