You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/09/23 13:30:16 UTC

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #1864: fs: Add the relative path support

patacongo commented on a change in pull request #1864:
URL: https://github.com/apache/incubator-nuttx/pull/1864#discussion_r493589778



##########
File path: fs/inode/fs_inodesearch.c
##########
@@ -430,6 +430,29 @@ static int _inode_search(FAR struct inode_search_s *desc)
   return ret;
 }
 
+/****************************************************************************
+ * Name: _inode_getcwd
+ *
+ * Description:
+ *   Return the current working directory
+ *
+ ****************************************************************************/
+
+static FAR const char *_inode_getcwd(void)
+{
+  FAR const char *pwd = "";
+
+#ifndef CONFIG_DISABLE_ENVIRON
+  pwd = getenv("PWD");
+  if (pwd == NULL)
+    {
+      pwd = CONFIG_LIB_HOMEDIR;
+    }
+#endif
+
+  return pwd;
+}
+

Review comment:
       getenv() is prototyped in stdlib.h which is not included by this file.  It may be being included through some sneak patch, but it is safer if stdlib.h were included explicitly.




----------------------------------------------------------------
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.

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