- case '#': break;
-
- case '$':
- /* further trim useless chars which are significant for in/output */
- xbt_str_rtrim(line+2," \t");
+ case '#': break;
+
+ case '$':
+ /* further trim useless chars which are significant for in/output */
+ xbt_str_rtrim(line+2," \t");
+
+ /* Deal with CD commands here, not in rctx */
+ if (!strncmp("cd ",line+2,3)) {
+ char *dir=line+4;
+
+ if (rctx->cmd)
+ rctx_start();
+
+ /* search beginning */
+ while (*(dir++) == ' ');
+ dir--;
+ VERB1("Saw cd '%s'",dir);
+ if (chdir(dir)) {
+ ERROR2("Chdir to %s failed: %s",dir,strerror(errno));
+ ERROR1("Test suite `%s': NOK (system error)", testsuite_name);
+ rctx_armageddon(rctx,4);
+ }
+ break;
+ } /* else, pushline */
+ case '&':
+ case '<':
+ case '>':
+ case '!':
+ rctx_pushline(filepos, line[0], line+2 /* pass '$ ' stuff*/);
+ break;