[Bug 2112445] Re: Incorrect evaluation of expr

Christian Ehrhardt 2112445 at bugs.launchpad.net
Wed Jun 4 10:36:47 UTC 2025


For the original problem as spotted in qemu builds Heinrich (thanks
again!) came up with:

From:
  len2=$$(($${#list}/2));
  if [ $$len2 -gt 36 ]; then \
     while expr substr "$$list" $$len2 1 != " " >/dev/null; do len2=$$(($$len2+1)); done; \
     list="$$(expr substr "$$list" 1 $$(($$len2-1)))\$${Newline} $$(expr substr "$$list" $$(($$len2+1)) $$len2)"; \
  fi; 

To:
  echo "$list" | fold -s -w 36 >> debian/qemu.subst

That is more the tool that is meant to do that and has the added benefit
of working with the rust coreutils already. I tested it with the lists
we get on armhf (short) and others (longer and broken up) - AFAICS it
works. @Heinich - I think it makes sense to submit that to Debian, do
you want to or should I?

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to rust-coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/2112445

Title:
  Incorrect evaluation of expr

Status in qemu package in Ubuntu:
  Invalid
Status in rust-coreutils package in Ubuntu:
  Confirmed

Bug description:
  I have installed rust-coreutils 0.0.30-2.

  I have created a symbolic link /usr/bin/expr =>
  /usr/lib/cargo/bin/coreutils/expr.

  When executing the appended script test.sh it does not find a space
  between words.

  With /usr/bin/expr => /usr/bin/gnuexpr the script finds a space.

  My expectation is that both binaries should be equivalent.

  Best regards

  Heinrich

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2112445/+subscriptions




More information about the foundations-bugs mailing list