@@ -115,7 +115,7 @@ typedef enum {
|
||||
|
||||
/*
|
||||
* Hook for user-defined debug function
|
||||
* Unify differnt module's func for registration
|
||||
* Unify different module's func for registration
|
||||
*/
|
||||
typedef UINT32 (*CmdCallBackFunc)(UINT32 argc, const CHAR **argv);
|
||||
|
||||
|
||||
7
components/shell/src/base/shcmd.c
Executable file → Normal file
7
components/shell/src/base/shcmd.c
Executable file → Normal file
@@ -69,10 +69,10 @@ CmdModInfo *OsCmdInfoGet(VOID)
|
||||
}
|
||||
|
||||
/*
|
||||
* Description: Pass in the string and clear useless space ,which inlcude:
|
||||
* Description: Pass in the string and clear useless space ,which include:
|
||||
* 1) The overmatch space which is not be marked by Quote's area
|
||||
* Squeeze the overmatch space into one space
|
||||
* 2) Clear all space before first vaild charatctor
|
||||
* 2) Clear all space before first vaild character
|
||||
* Input: cmdKey : Pass in the buff string, which is ready to be operated
|
||||
* cmdOut : Pass out the buffer string ,which has already been operated
|
||||
* size : cmdKey length
|
||||
@@ -98,6 +98,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsCmdKeyShift(const CHAR *cmdKey, CHAR *cmdOut, UI
|
||||
PRINTK("malloc failure in %s[%d]", __FUNCTION__, __LINE__);
|
||||
return (UINT32)OS_ERROR;
|
||||
}
|
||||
(VOID)memset_s(output, len + 1, 0, len + 1);
|
||||
/* Backup the 'output' start address */
|
||||
outputBak = output;
|
||||
/* Scan each charactor in 'cmdKey',and squeeze the overmuch space and ignore invaild charactor */
|
||||
@@ -110,7 +111,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsCmdKeyShift(const CHAR *cmdKey, CHAR *cmdOut, UI
|
||||
/* 1) Quotes matching status is FALSE (which said that the space is not been marked by double quotes) */
|
||||
/* 2) Current charactor is a space */
|
||||
/* 3) Next charactor is a space too, or the string is been seeked to the end already(\0) */
|
||||
/* 4) Invaild charactor, such as single quotes */
|
||||
/* 4) Invalid charactor, such as single quotes */
|
||||
if ((*cmdKey == ' ') && ((*(cmdKey + 1) == ' ') || (*(cmdKey + 1) == '\0')) && QUOTES_STATUS_CLOSE(quotes)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
0
components/shell/src/base/shcmdparse.c
Executable file → Normal file
0
components/shell/src/base/shcmdparse.c
Executable file → Normal file
@@ -96,7 +96,7 @@ CHAR *GetCmdName(const CHAR *cmdline, UINT32 len)
|
||||
continue;
|
||||
}
|
||||
/* If detected a space which the quotes matching status is false */
|
||||
/* which said has detected the first space for seperator, finish this scan operation */
|
||||
/* which said has detected the first space for separator, finish this scan operation */
|
||||
if ((*tmpStr == ' ') && (QUOTES_STATUS_CLOSE(quotes))) {
|
||||
break;
|
||||
}
|
||||
|
||||
0
components/shell/src/base/show.c
Executable file → Normal file
0
components/shell/src/base/show.c
Executable file → Normal file
0
components/shell/src/cmds/date_shell.c
Executable file → Normal file
0
components/shell/src/cmds/date_shell.c
Executable file → Normal file
4
components/shell/src/cmds/fullpath.c
Executable file → Normal file
4
components/shell/src/cmds/fullpath.c
Executable file → Normal file
@@ -203,14 +203,14 @@ STATIC CHAR *VfsNormalizeFullpath(const CHAR *directory, const CHAR *filename, C
|
||||
CHAR *fullpath = NULL;
|
||||
|
||||
if (filename[0] != '/') {
|
||||
/* not a absolute path */
|
||||
/* not an absolute path */
|
||||
|
||||
fullpath = VfsNotAbsolutePath(directory, filename, pathname, namelen);
|
||||
if (fullpath == NULL) {
|
||||
return (CHAR *)NULL;
|
||||
}
|
||||
} else {
|
||||
/* it's a absolute path, use it directly */
|
||||
/* it's an absolute path, use it directly */
|
||||
|
||||
fullpath = strdup(filename); /* copy string */
|
||||
if (fullpath == NULL) {
|
||||
|
||||
0
components/shell/src/cmds/mempt_shellcmd.c
Executable file → Normal file
0
components/shell/src/cmds/mempt_shellcmd.c
Executable file → Normal file
0
components/shell/src/cmds/shell_shellcmd.c
Executable file → Normal file
0
components/shell/src/cmds/shell_shellcmd.c
Executable file → Normal file
0
components/shell/src/cmds/task_shellcmd.c
Executable file → Normal file
0
components/shell/src/cmds/task_shellcmd.c
Executable file → Normal file
1
components/shell/src/cmds/vfs_shellcmd.c
Executable file → Normal file
1
components/shell/src/cmds/vfs_shellcmd.c
Executable file → Normal file
@@ -209,6 +209,7 @@ VOID OsLs(const CHAR *pathname)
|
||||
}
|
||||
} while (pdirent != NULL);
|
||||
|
||||
free(path);
|
||||
(VOID)closedir(d);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user