public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] hashtable lib and escaping
Date: Thu, 01 Nov 2012 21:00:53 +0100	[thread overview]
Message-ID: <20121101200053.3D408200230@gemini.denx.de> (raw)
In-Reply-To: <ED3E0BCACD909541BA94A34C4A164D4C425CEE7A@post.tritech.se>

Dear Mats K?rrman,

In message <ED3E0BCACD909541BA94A34C4A164D4C425CEE7A@post.tritech.se> 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

  reply	other threads:[~2012-11-01 20:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01 17:45 [U-Boot] hashtable lib and escaping Mats Kärrman
2012-11-01 20:00 ` Wolfgang Denk [this message]
2012-11-02  7:30   ` Mats Kärrman
2012-11-02 22:20     ` Wolfgang Denk
2012-11-05 13:34       ` Mats Kärrman
2012-11-05 18:33         ` Wolfgang Denk
2012-11-06  7:35           ` Mats Kärrman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121101200053.3D408200230@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox