Re: [mu TECH] Midnight Commander's F3 View starts slow?

From: Alfie Costa (agcosta@gis.net)
Date: Wed Feb 23 2000 - 07:37:29 CET


On 18 Feb 00, at 9:15, Alfie Costa <mulinux@sunsite.auc.dk> wrote:

{A soliloquy regarding attempted optimizations to mu's /bin/file}
> 3) After some struggle trying to figure out how /bin/ash stores variables,
> I've mutated the two functions in "file", TestString() and TestOctal(), so
> they do all their work with variables and don't write any temporary files.
> This is where the speed-up comes from...

Problem. /bin/ash seems to be working with null-terminated strings, which
means that nulls (octal \000) can't be stored in variables. Every other byte
can, 1-255, just not 0. For octal comparisons that use \000 as one of the
magic numbers, this goofs with the data...

Example:
A=\\055\\000\\077
B=\\055\\077\\000

So a test of "$A"="$B" would return true, as both variables would turn into
"\055\077".

Another /bin/ash feature is that it changes the length of such strings.
Example2:
A=\\000\\055\\000\\077

"$A" ought to be 4 characters long, but the null-termination problem makes it
only 2 chars long.

Ugly kludges in progress...

Is the mu list the right place for this sort of thing? "Alas, poor Yorick!"

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: mulinux-help@sunsite.auc.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:13 CET