chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Assume initial digits in a track name are a sort key even without the
[disorder]
/
lib
/
macros-builtin.c
diff --git
a/lib/macros-builtin.c
b/lib/macros-builtin.c
index 24822bbf66d783e5fe1d30b3749a853a67d1dd8d..ec5628da145ff145ab2ba9fd785c5a821ab3f202 100644
(file)
--- a/
lib/macros-builtin.c
+++ b/
lib/macros-builtin.c
@@
-25,17
+25,12
@@
* generated from the comments at the head of each function.
*/
* 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 <errno.h>
-#include <assert.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <sys/wait.h>
#include "hash.h"
#include "mem.h"
#include "hash.h"
#include "mem.h"
@@
-71,13
+66,14
@@
int mx_bool_result(struct sink *output, int result) {
}
/** @brief Search the include path */
}
/** @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) {
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);
return 0;
}
path = xstrdup(name);
@@
-89,7
+85,8
@@
char *mx_find(const char *name) {
break;
}
if(n >= include_path.nvec) {
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;
}
}
return 0;
}
}
@@
-123,7
+120,7
@@
static int exp_include(int attribute((unused)) nargs,
char buffer[4096];
struct stat sb;
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;
if(sink_printf(output, "[[cannot find '%s']]", args[0]) < 0)
return 0;
return 0;