Commit Graph

35 Commits

Author SHA1 Message Date
wangmingrong
5e59b0b384 nshlib: Fix static scanning errors
Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2023-09-08 18:49:31 +08:00
Xiang Xiao
6aa05b5855 Replace strlen with sizeof for kconfig string
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-02 16:26:51 +03:00
wangmingrong
7981278021 apps/nshlib: Add the pidof command and API nsh_getpid
Add the API "nsh_getpid" in "nsh_fsutils. c" and the nsh command pidof. Temporarily support two parameters, - s, and process name

Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2023-08-29 02:58:45 +08:00
Xiang Xiao
359f66ad37 nshlib: Remove the remaining CONFIG_FILE_STREAM dependence
continue the change from https://github.com/apache/nuttx-apps/pull/1559

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-24 17:38:19 +08:00
Xiang Xiao
a29d9ea9da fsutils/examples: Include unistd.h explicitly
to get the prototypes or macros are defined in it

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-05 08:46:59 +02:00
Petro Karashchenko
ec1c5f9273 Revert "Revert "nshlib: fix possible out of bounds array access""
This reverts commit fe4b44e3ff.
2022-10-24 01:13:27 +08:00
Petro Karashchenko
fe4b44e3ff Revert "nshlib: fix possible out of bounds array access"
This reverts commit f6a86a578d.
2022-10-23 08:29:01 +02:00
Petro Karashchenko
f6a86a578d nshlib: fix possible out of bounds array access
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-23 11:45:52 +08:00
Fotis Panagiotopoulos
1c7839c28c Fixed compiler warnings. 2022-08-30 12:10:49 +08:00
Fotis Panagiotopoulos
d7ec4e51b5 nsh: Fixed typos in comments. 2022-07-22 00:03:22 +08:00
Xiang Xiao
c252ec1481 Add printflike to all printf like functions
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-18 14:09:10 +03:00
ligd
d6a187efed nshlib: merge nsh_getdirpath() to nsh_fsutils.c
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-30 02:36:13 +08:00
Jiuzhu Dong
283b1a4dfc nshlib/cmd_memdump: support new command: memdump
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-02-24 02:16:00 +08:00
Alin Jerpelea
4f3f62c8fc nshlib: update licenses to Apache
Gregory Nutt is has submitted the SGA

Uros Platise has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-11 02:42:05 -05:00
Xiang Xiao
1ee948e0c8 Include assert.h for DEBUGASSERT caller
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-24 12:34:37 +09:00
Subhra Sankha Sarkar
76e58d9e55 Fixed coding std violations in nsh_fsutils.h 2020-10-28 06:43:43 -07:00
Subhra Sankha Sarkar
0d74608b2c Fixed build issues 2020-10-28 05:57:47 -07:00
Subhra Sankha Sarkar
23ec80fa30 Addressed review comments from @v01d and @xiaoxiang781216 2020-10-28 05:57:47 -07:00
Xiang Xiao
41d88f06e7 Run codespell -w with the latest dictonary again 2020-02-23 07:10:14 -06:00
Xiang Xiao
d660492289 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:41:36 -06:00
Xiang Xiao
e0dcfa0c55 Remove extra whitespace from files (#43)
* Remove multiple newlines at the end of file
* Remove the white space from the end of line
2020-01-31 08:29:24 -06:00
Xiang Xiao
857158451b Unify the void cast usage
1.Remove void cast for function because many place ignore the returned value witout cast
2.Replace void cast for variable with UNUSED macro

Change-Id: Ie644129a563244a6397036789c4c3ea83c4e9b09
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-02 23:21:01 +08:00
Gregory Nutt
49e08ca3a9 apps/nshlib/nsh_fsutils.c: As noted by David S. Alessio, 'cat' should not output any additional newline at the end of the cat'ed file content. This was done to assure that the NSH prompt was presented on a new line. However, that is not the correct behavior of 'cat' per the IEEE std: "The standard output shall contain the sequence of bytes read from the input files. Nothing else shall be written to the standard output." Reference: https://pubs.opengroup.org/onlinepubs/009695399/utilities/cat.html
This commit changes the function nsh_catfile() which underlies the 'cat' command and well as other NSH commands.  Although this is the correct behavior for 'cat' it may not be the correct behavor for other commands implemented via nsh_catfile().  That remains to be determined.
2019-07-29 20:49:39 -06:00
Gregory Nutt
8f5944c4a8 Squashed commit of the following:
include/ and netutils/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    nshlib/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    system/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    testing/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    examples/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
2019-04-29 14:53:38 -06:00
GregoryN
3bf4b6d245 Merged altconsole into master 2018-12-08 18:53:54 -06:00
Xiang Xiao
173c985395 nshlib/nsh_fsutils.c: nsh_catfile() should not append '\n' if the last char in file is already '\n' 2018-11-07 11:23:07 -06:00
Gregory Nutt
50f44f23f2 Fix an error in last commit; eliminate a warning 2016-01-06 10:14:09 -06:00
Gregory Nutt
082b452016 Move string trimming logic in nsh_fsutils.c as nsh_trimspaces() 2015-11-28 15:01:00 -06:00
Gregory Nutt
64c7e31896 nshlib: Correct an error message 2015-11-28 11:57:37 -06:00
Gregory Nutt
88d3ac1c92 apps/nshlib: nsh_readfile() should not be marked as static 2015-11-28 11:39:50 -06:00
Gregory Nutt
92b1eb36c8 nshlib: Move trim_dir() and foreach_direntry() from nsh_fscmds.c to nsh_fsutils.c as nsh_trimdir() and nsh_foreach_direntry(), respectively 2015-11-28 08:29:27 -06:00
Gregory Nutt
510f325ae4 nshlib: Use CONFIG_NSH_PROC_MOUNTPOINT instead of literal /proc; Move readfile() from nsh_proccmds.c to nsh_fsutils.c as nsh_readfile() 2015-11-28 07:23:08 -06:00
Gregory Nutt
6c6df5e4ed Remove some ifdef'ed out logic 2015-11-27 13:54:04 -06:00
Gregory Nutt
ee7df4a0ab Remove carriage returns from a new file 2015-11-27 13:05:02 -06:00
Gregory Nutt
32b992971b apps/nshlib: The 'ifconfig' command now uses /proc/net/stat to show network statistics. A consequence of this is that you cannot view network statistics if the procfs is not enabled and mounted at /proc 2015-11-27 13:04:11 -06:00