From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Thu, 01 Nov 2012 21:00:53 +0100 Subject: [U-Boot] hashtable lib and escaping In-Reply-To: References: Message-ID: <20121101200053.3D408200230@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Mats K?rrman, In message you wrote: > > I used to have a working setup using U-Boot 2009.03 before upgrading to U-Boot 2012.07. The problem I'm facing is related to the escaping policies of lib/hashtable.c. > > What I did before was for example having something like this in my default environment: > > bootcmd=run first_boot > first_boot=setenv bootcmd my_select\;run ubi_boot;saveenv;boot THis syntax has never been correct. If it ever worked, than only by chance (read: because of incorrect/imperfect code). > With the escape parsing of himport_r(), the '\' is simply dropped and it is no longer possible to escape ';' so the "run ubi_boot" is immediately executed and nothing is saved... The function header mentions the possibility for multi-line values but thi > s should not come at the cost of not being able to escape ';'. You have to be casreful here and keep in mind that (de-) escaping will take place in a different places: himport() (resp. setenv()) is only one part of this story - the other part is when you will actually pass this string to the command processor (the shell). See here: => setenv foo 'echo part one\;echo part two' ; print foo ; run foo foo=echo part one;echo part two part one part two => setenv foo 'echo part one\\;echo part two' ; print foo ; run foo foo=echo part one\;echo part two part one;echo part two => Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "No matter where you go, there you are..." - Buckaroo Banzai