After some playing around with wordexp, I'm inclined to leave things alone.
wordexp just does too much.
Unbalanced parens or brackets or quotes or apostrophes
will produce a syntax error.
Here's a filename with one apostrophe in it.
#include <stdio.h>
#include <wordexp.h>
main()
{
wordexp_t w;
int rc;
rc = wordexp("isn't", &w, 0);
if(rc == WRDE_SYNTAX)
puts("syntax error");
}
And even if the quotes are balanced, they will be taken away from you.
#include <stdio.h>
#include <wordexp.h>
main()
{
wordexp_t w;
int rc;
rc = wordexp("is'n't", &w, 0);
puts(w.we_wordv[0]);
}
So many side effects that I'm sure people will be confused.
I already wrote the code and it's been working for years,
guess I'll leave it alone.
Karl Dahlke
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev