[PATCH] space on prompt bugfix

Jindrich Novy jnovy at redhat.com
Mon Mar 21 08:19:34 UTC 2005


Hi mc-devel!

There's a bug I've been annoyed with for some time so I finally decided
to fix it.

To reproduce:
1. start mc
2. go to some directory where you see some further subdirectories
3. press space once or for more times -> spaces will appear in the
command prompt
4. try to go to some subdirectory by pressing enter on it or press enter
on any *.c, *.mp3 file.

Results:
You're unable to change a directory until you delete all spaces typed on
command prompt and mc does nothing while you're pressing Enter.
Furthermore you're unable to launch any application by tapping enter on
*.c, *.mp3 files, etc.

I did two patches to fix it so that you can decide which one is better
commit candidate.

Patch1:
Allows an user to type leading spaces on the command prompt, but when
enter is pressed, it tests whether the user typed at least something
except spaces. In case it finds only spaces, it deletes them from the
command prompt and let the enter be further processed.

Patch2:
Doesn't let the user to type leading spaces if he didn't write a non-
space letter already.

Note that both the patches also contain fix for a redundant strlen ()
call.

Cheers,
Jindrich

-- 
Jindrich Novy <jnovy at redhat.com>, http://people.redhat.com/jnovy/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc-spaceprompt1.patch
Type: text/x-patch
Size: 1051 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20050321/7ba0f8e2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc-spaceprompt2.patch
Type: text/x-patch
Size: 765 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20050321/7ba0f8e2/attachment-0001.bin>


More information about the mc-devel mailing list