From 03d81ef43aca1808255d1a2a19ec394ed805eee8 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 13 Jan 2010 14:53:49 +0100 Subject: [PATCH] builtin_read: note about better implementation Signed-off-by: Denys Vlasenko --- shell/builtin_read.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell/builtin_read.c b/shell/builtin_read.c index 412bcf869..73b0949cf 100644 --- a/shell/builtin_read.c +++ b/shell/builtin_read.c @@ -20,6 +20,11 @@ #include "shell_common.h" #include "builtin_read.h" +//TODO: use more efficient setvar() which takes a pointer to malloced "VAR=VAL" +//string. hush naturally has it, and ash has setvareq(). +//Here we can simply store "VAR=" at buffer start and store read data directly +//after "=", then pass buffer to setvar() to consume. + const char* FAST_FUNC shell_builtin_read(void FAST_FUNC (*setvar)(const char *name, const char *val), char **argv, -- 2.25.1