🌈 style:
This commit is contained in:
@@ -29,9 +29,9 @@ static void prompt(void)
|
||||
* @param line
|
||||
* @param res
|
||||
*/
|
||||
static void parse(char *line, struct cmd_st *res)
|
||||
static void parse(char* line, struct cmd_st* res)
|
||||
{
|
||||
char *tok;
|
||||
char* tok;
|
||||
int i = 0;
|
||||
|
||||
//* 根据分隔符分割小串
|
||||
@@ -52,16 +52,16 @@ static void parse(char *line, struct cmd_st *res)
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
char *linebuf = NULL;
|
||||
char* linebuf = NULL;
|
||||
size_t linebuf_size = 0;
|
||||
struct cmd_st cmd;
|
||||
pid_t pid;
|
||||
|
||||
while (1)
|
||||
{
|
||||
prompt();
|
||||
prompt( );
|
||||
|
||||
if (getline(&linebuf, &linebuf_size, stdin) < 0)
|
||||
break;
|
||||
@@ -74,7 +74,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else // 外部命令
|
||||
{
|
||||
pid = fork();
|
||||
pid = fork( );
|
||||
if (pid < 0)
|
||||
{
|
||||
perror("fork");
|
||||
|
||||
Reference in New Issue
Block a user