syntax-file: Open syntax files immediately, instead of delaying.
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 29 Sep 2010 04:19:59 +0000 (21:19 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 29 Sep 2010 04:19:59 +0000 (21:19 -0700)
commit0853dd47066b6bfbfe8377adb146394e15926811
tree17e4218ce3a7840668a3e8e8bdf47e5ab9b38d27
parentba05dffdad5259167ce989181710b2ea10801955
syntax-file: Open syntax files immediately, instead of delaying.

Until now, syntax files have been opened only when the first line needs to
be read.  This commit changes behavior to open syntax files as soon as the
syntax file source is created.

This fixes the behavior INSERT CD=YES when a relative file path is
specified.  Without this commit, INSERT checks that the file exists, then
it creates the syntax file source, then it chdirs into the syntax file's
directory, and then the syntax file source tries to open the file, which
fails because the relative path is no longer correct.  With this commit,
the file gets opened before the chdir, so it succeeds.

The following commit will add a test to prevent regression.
src/language/syntax-file.c