diff --git a/mode/c.py b/mode/c.py index 40fdd10..8b171a4 100644 --- a/mode/c.py +++ b/mode/c.py @@ -139,26 +139,24 @@ class CCheckSyntax(Exec): show_success = False args = [] def _execute(self, w, **vargs): + cmd='C_INCLUDE_PATH=. %s' % w.application.config['c.syntax-cmd'] if w.application.config['c.syntax-rel-dir']: - d = os.path.dirname(w.buffer.path) - self._doit(w, w.buffer.path, w.application.config['c.syntax-cmd'], - cmdname='c-check-syntax', cmddir=d) + self._doit(w, w.buffer.path, cmd, cmdname='c-check-syntax', + cmddir=os.path.dirname(w.buffer.path)) else: - self._doit(w, w.buffer.path, w.application.config['c.syntax-cmd'], - cmdname='c-check-syntax') + self._doit(w, w.buffer.path, cmd, cmdname='c-check-syntax') class CMake(Exec): '''Build this C program (using the mode's make cmd)''' show_success = False args = [] def _execute(self, w, **vargs): + cmd = w.application.config['c.make-cmd'], if w.application.config['c.make-rel-dir']: - d = os.path.dirname(w.buffer.path) - self._doit(w, w.buffer.path, w.application.config['c.make-cmd'], - cmdname='c-make', cmddir=d) + d = os.path.dirname(w.buffer.path) + self._doit(w, w.buffer.path, cmd, cmdname='c-make', cmddir=d) else: - self._doit(w, w.buffer.path, w.application.config['c.make-cmd'], - cmdname='c-make') + self._doit(w, w.buffer.path, cmd, cmdname='c-make') class C(Fundamental): name = 'C'