From 495c7c195f92ce4cd8d621944b5639a10fa45d60 Mon Sep 17 00:00:00 2001 From: KAAAsS Date: Thu, 21 Apr 2022 14:28:39 +0800 Subject: [PATCH] =?UTF-8?q?lab5:=20=E6=8C=87=E4=BB=A4=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E5=8F=AF=E8=83=BD=E7=BC=BA=E5=B0=91=E7=A9=BA?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab5/user/lab5/apps/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lab5/user/lab5/apps/init.c b/lab5/user/lab5/apps/init.c index 01a75c5..d4db52a 100644 --- a/lab5/user/lab5/apps/init.c +++ b/lab5/user/lab5/apps/init.c @@ -148,6 +148,9 @@ static char *match_builtin_command_param(char *complement, int complement_time, if (matched) { // 如果匹配到,就进行拼接 memcpy(buf, complement, start_pos); + if (buf[start_pos - 1] != ' ') { + buf[start_pos++] = ' '; + } strcpy(buf + start_pos, matched); return buf; }