From 082f05c910e6120b5d9c6cbc8879fdc4fadbedde Mon Sep 17 00:00:00 2001 From: CaiBin <342571403@qq.com> Date: Thu, 17 Mar 2022 16:29:23 +0800 Subject: [PATCH] Minor fix-ups. --- IPCIF/src/fs_sh/fs_sh/sh_cmd_linux.cpp | 38 +++++++++---------- misc/unittest/unittest/fs_sh/sh_cmd_linux.cpp | 38 +++++++++---------- 2 files changed, 36 insertions(+), 40 deletions(-) diff --git a/IPCIF/src/fs_sh/fs_sh/sh_cmd_linux.cpp b/IPCIF/src/fs_sh/fs_sh/sh_cmd_linux.cpp index 33aeea8..9134201 100755 --- a/IPCIF/src/fs_sh/fs_sh/sh_cmd_linux.cpp +++ b/IPCIF/src/fs_sh/fs_sh/sh_cmd_linux.cpp @@ -77,19 +77,18 @@ static int check_args(vector>& args,bool mute=false) } else { + int ret=0; for(int i=0;i(*p,"")); - break; - } + if(cmd_head!=s_alias[i].alias) + continue; + if(0!=(ret=check_args(args))) + return ret; + args.erase(args.begin()); + int j; + const char** p; + for(j=0,p=s_alias[i].full;*p!=NULL;j++,p++) + args.insert(args.begin()+j,pair(*p,"")); + break; } generate_cmd(args,cmd); if(0!=(ret=system(cmd.c_str()))) diff --git a/misc/unittest/unittest/fs_sh/sh_cmd_linux.cpp b/misc/unittest/unittest/fs_sh/sh_cmd_linux.cpp index 33aeea8..9134201 100755 --- a/misc/unittest/unittest/fs_sh/sh_cmd_linux.cpp +++ b/misc/unittest/unittest/fs_sh/sh_cmd_linux.cpp @@ -77,19 +77,18 @@ static int check_args(vector>& args,bool mute=false) } else { + int ret=0; for(int i=0;i(*p,"")); - break; - } + if(cmd_head!=s_alias[i].alias) + continue; + if(0!=(ret=check_args(args))) + return ret; + args.erase(args.begin()); + int j; + const char** p; + for(j=0,p=s_alias[i].full;*p!=NULL;j++,p++) + args.insert(args.begin()+j,pair(*p,"")); + break; } generate_cmd(args,cmd); if(0!=(ret=system(cmd.c_str())))