From 18221c5be458a4f15184d81d5ba950b583e85eac Mon Sep 17 00:00:00 2001 From: TNT_TS Date: Wed, 1 Jul 2026 17:09:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9static=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=88=B0extern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/shell.h | 6 +++--- src/shell.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/shell.h b/include/shell.h index 8e99bea..38effcc 100644 --- a/include/shell.h +++ b/include/shell.h @@ -15,9 +15,9 @@ typedef struct { int occupied; // 开放寻址必须有的“已占用”标记 } ShellCmdEntry; -static char currentUser[USERNAME_MAX]; -static int cmdCount; -static ShellCmdEntry cmdBucket[CMDSIZE_MAX]; +extern char currentUser[USERNAME_MAX]; +extern int cmdCount; +extern ShellCmdEntry cmdBucket[CMDSIZE_MAX]; int shellInit(char *username); int shellLoop(); diff --git a/src/shell.c b/src/shell.c index 824a973..4dabcdb 100644 --- a/src/shell.c +++ b/src/shell.c @@ -4,7 +4,9 @@ #include #include #include - +char currentUser[USERNAME_MAX]; +int cmdCount; +ShellCmdEntry cmdBucket[CMDSIZE_MAX]; /* 初始化shell,注册命令,传入登录的用户名 */ int shellInit(char *username) { cmdCount = 0;