Re: [PR] tools/nxstyle.c: fix error Relative file path on Windows Native [nuttx]

2025-05-19 Thread via GitHub


xiaoxiang781216 merged PR #16396:
URL: https://github.com/apache/nuttx/pull/16396


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] tools/nxstyle.c: fix error Relative file path on Windows Native [nuttx]

2025-05-19 Thread via GitHub


simbit18 commented on PR #16396:
URL: https://github.com/apache/nuttx/pull/16396#issuecomment-2890009093

   @raiden00pl done


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] tools/nxstyle.c: fix error Relative file path on Windows Native [nuttx]

2025-05-17 Thread via GitHub


raiden00pl commented on code in PR #16396:
URL: https://github.com/apache/nuttx/pull/16396#discussion_r2093982218


##
tools/nxstyle.c:
##
@@ -719,6 +723,63 @@ static void show_usage(char *progname, int exitcode, char 
*what)
   exit(exitcode);
 }
 
+#ifndef HAVE_STRNDUP
+/
+ * Name: my_strndup
+ *
+ * Description:
+ *   Duplicate a specific number of bytes from a string.
+ *   Implementation of strndup() for Windows Native
+ *   MinGW does not seem to provide strndup
+ 
/

Review Comment:
   ```suggestion
*   MinGW does not seem to provide strndup

/

   ```
   
   look at https://github.com/apache/nuttx/issues/12133



##
tools/nxstyle.c:
##
@@ -719,6 +723,63 @@ static void show_usage(char *progname, int exitcode, char 
*what)
   exit(exitcode);
 }
 
+#ifndef HAVE_STRNDUP
+/
+ * Name: my_strndup
+ *
+ * Description:
+ *   Duplicate a specific number of bytes from a string.
+ *   Implementation of strndup() for Windows Native
+ *   MinGW does not seem to provide strndup
+ 
/
+
+char *my_strndup(const char *s, size_t size)
+{
+  char *dest = NULL;
+  size_t len;
+
+  len = strnlen(s, size);
+  len = len < size ? len : size;
+  dest = malloc(len + 1);
+
+  if (dest == NULL)
+{
+  return NULL;
+}
+
+  memcpy(dest, s, len);
+  dest[len] = '\0';
+  return dest;
+}
+#undef strndup
+#  define strndup my_strndup
+#endif
+
+/
+ * Name: backslash_to_slash
+ *
+ * Description:
+ *   Replace backslashes \ to forward slashes /.
+ 
/

Review Comment:
   ```suggestion
*   Replace backslashes \ to forward slashes /.

/

   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] tools/nxstyle.c: fix error Relative file path on Windows Native [nuttx]

2025-05-16 Thread via GitHub


raiden00pl commented on code in PR #16396:
URL: https://github.com/apache/nuttx/pull/16396#discussion_r2093982218


##
tools/nxstyle.c:
##
@@ -719,6 +723,63 @@ static void show_usage(char *progname, int exitcode, char 
*what)
   exit(exitcode);
 }
 
+#ifndef HAVE_STRNDUP
+/
+ * Name: my_strndup
+ *
+ * Description:
+ *   Duplicate a specific number of bytes from a string.
+ *   Implementation of strndup() for Windows Native
+ *   MinGW does not seem to provide strndup
+ 
/

Review Comment:
   ```suggestion
*   MinGW does not seem to provide strndup
*

/
   ```
   
   look at https://github.com/apache/nuttx/issues/12133



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] tools/nxstyle.c: fix error Relative file path on Windows Native [nuttx]

2025-05-16 Thread via GitHub


raiden00pl commented on code in PR #16396:
URL: https://github.com/apache/nuttx/pull/16396#discussion_r2093982271


##
tools/nxstyle.c:
##
@@ -719,6 +723,63 @@ static void show_usage(char *progname, int exitcode, char 
*what)
   exit(exitcode);
 }
 
+#ifndef HAVE_STRNDUP
+/
+ * Name: my_strndup
+ *
+ * Description:
+ *   Duplicate a specific number of bytes from a string.
+ *   Implementation of strndup() for Windows Native
+ *   MinGW does not seem to provide strndup
+ 
/
+
+char *my_strndup(const char *s, size_t size)
+{
+  char *dest = NULL;
+  size_t len;
+
+  len = strnlen(s, size);
+  len = len < size ? len : size;
+  dest = malloc(len + 1);
+
+  if (dest == NULL)
+{
+  return NULL;
+}
+
+  memcpy(dest, s, len);
+  dest[len] = '\0';
+  return dest;
+}
+#undef strndup
+#  define strndup my_strndup
+#endif
+
+/
+ * Name: backslash_to_slash
+ *
+ * Description:
+ *   Replace backslashes \ to forward slashes /.
+ 
/

Review Comment:
   ```suggestion
*   Replace backslashes \ to forward slashes /.
*

/
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org