* generated from the comments at the head of each function.
*/
-#include <config.h>
-#include "types.h"
+#include "common.h"
-#include <stdio.h>
-#include <string.h>
#include <errno.h>
-#include <assert.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <sys/wait.h>
#include "hash.h"
#include "mem.h"
}
/** @brief Search the include path */
-char *mx_find(const char *name) {
+char *mx_find(const char *name, int report) {
char *path;
int n;
if(name[0] == '/') {
if(access(name, O_RDONLY) < 0) {
- error(errno, "cannot read %s", name);
+ if(report)
+ error(errno, "cannot read %s", name);
return 0;
}
path = xstrdup(name);
break;
}
if(n >= include_path.nvec) {
- error(0, "cannot find '%s' in search path", name);
+ if(report)
+ error(0, "cannot find '%s' in search path", name);
return 0;
}
}
char buffer[4096];
struct stat sb;
- if(!(path = mx_find(args[0]))) {
+ if(!(path = mx_find(args[0], 1/*report*/))) {
if(sink_printf(output, "[[cannot find '%s']]", args[0]) < 0)
return 0;
return 0;