[PATCH] ext.c, regex_command ()



Hello, there!

This patch makes the handling of the 'type/' directive much better. It
also improve the quality of the code.

 o It checks if the data in 'content_string' is valid and doesn't
   preform any further checks, whether it matches a regex.

 o There was such check in the original, code but it wasn't handled
   properly, so that it wouldn't be used at all.

 o Almost all of the code is guarded by the 'asked_file' variable.

 o When reading from remote or local vfs with read the same number of
   bytes - i.e. maximum sizeof (content_string - 1).

 o Other things - I dont't remember :)

I hope that it won't be considered too intrusive :)

Btw - 2 questions:

1. Why this piece of code doesn't use the subshell ?

2. If it's going to live like that for the time being is
it acceptable at least to redirect the error output
to the standard output so if 'file' is missing the user
doesn't get its prompt messed up.

Thanks! :)

Pavel Tsekov

Attachment: regex_command_ext.c.diff
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]