Skip to content

apps/nshlib/cmd_cd: Modify the logic of cd#2732

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
W-M-R:zhengyu
Oct 17, 2024
Merged

apps/nshlib/cmd_cd: Modify the logic of cd#2732
xiaoxiang781216 merged 1 commit into
apache:masterfrom
W-M-R:zhengyu

Conversation

@W-M-R
Copy link
Copy Markdown
Contributor

@W-M-R W-M-R commented Oct 15, 2024

Summary

Modify the implementation logic of changing directory. There's an error handling the path incluing "../" or "./"

bug examples:

nsh> cd proc/self/group
nsh> cd ../..
nsh: cd: chdir failed: 2

nsh> pwd
/proc/self
nsh> ls
/proc/self:
status
cmdline
stack
group/
nsh> cd ./group
nsh: cd: chdir failed: 2

Impact

No

Testing

No

depends on apache/nuttx#14365

@W-M-R W-M-R force-pushed the zhengyu branch 2 times, most recently from b3489a7 to d3a586f Compare October 16, 2024 06:33
@W-M-R
Copy link
Copy Markdown
Contributor Author

W-M-R commented Oct 16, 2024

This change involves enabling the variable configuration to support nsh, that is, turning off CONFIG_DISABLE_ENVIRON. Many boards' configs are not enabled, so it is difficult to merge it in. I have to push it back and see how to merge them in.

@xiaoxiang781216
Copy link
Copy Markdown
Contributor

This change involves enabling the variable configuration to support nsh, that is, turning off CONFIG_DISABLE_ENVIRON. Many boards' configs are not enabled, so it is difficult to merge it in. I have to push it back and see how to merge them in.

I will provide a patch fix this problem.

@xiaoxiang781216
Copy link
Copy Markdown
Contributor

Here is the patch: apache/nuttx#14365

@W-M-R
Copy link
Copy Markdown
Contributor Author

W-M-R commented Oct 16, 2024

I will provide a patch fix this problem.

OK,thanks,brother Xiang

@xiaoxiang781216
Copy link
Copy Markdown
Contributor

@W-M-R please repush your patch

Modify the implementation logic of changing directory.
There's an error handling the path incluing "../" or "./"

bug examples:

nsh> cd proc/self/group
nsh> cd ../..
nsh: cd: chdir failed: 2

nsh> pwd
/proc/self
nsh> ls
/proc/self:
 status
 cmdline
 stack
 group/
nsh> cd ./group
nsh: cd: chdir failed: 2

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
@xiaoxiang781216 xiaoxiang781216 merged commit 697e3be into apache:master Oct 17, 2024
@W-M-R W-M-R deleted the zhengyu branch October 21, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants