aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-08-13 11:43:26 +0100
committerRon Yorston <rmy@pobox.com>2020-08-13 14:58:01 +0100
commit7d639339e0c46311f8873d560e6f168e71473cd9 (patch)
treee483966b030472f5c0ae85c0a11f090acbaa57ff /shell
parent258ad6a1d52f1811f9de1d6b976f3797f5b31a2b (diff)
downloadbusybox-w32-7d639339e0c46311f8873d560e6f168e71473cd9.tar.gz
busybox-w32-7d639339e0c46311f8873d560e6f168e71473cd9.tar.bz2
busybox-w32-7d639339e0c46311f8873d560e6f168e71473cd9.zip
win32: use a static buffer in get_system_drive()
Allocate static storage for the system drive string instead of making a new allocation on every call. This is easier to manage. Adds 16 bytes.
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index db7b18957..7a2d0ab68 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -15245,7 +15245,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
15245 struct stackmark smark; 15245 struct stackmark smark;
15246 int login_sh; 15246 int login_sh;
15247#if ENABLE_PLATFORM_MINGW32 15247#if ENABLE_PLATFORM_MINGW32
15248 char *sd; 15248 const char *sd;
15249 15249
15250 INIT_G_memstack(); 15250 INIT_G_memstack();
15251 15251
@@ -15366,7 +15366,6 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
15366 if (sd) { 15366 if (sd) {
15367 char *path = xasprintf("%s/etc/profile", sd); 15367 char *path = xasprintf("%s/etc/profile", sd);
15368 read_profile(path); 15368 read_profile(path);
15369 free(sd);
15370 free(path); 15369 free(path);
15371 } 15370 }
15372 else 15371 else