summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/patch.c10
-rw-r--r--src/safe.c1
-rw-r--r--src/util.h2
3 files changed, 7 insertions, 6 deletions
diff --git a/src/patch.c b/src/patch.c
index bf7e5c2..6c76276 100644
--- a/src/patch.c
+++ b/src/patch.c
@@ -241,8 +241,8 @@ main (int argc, char **argv)
{
say ("File %s: can't change file type from 0%o to 0%o.\n",
quotearg (inname),
- pch_mode (reverse) & S_IFMT,
- pch_mode (! reverse) & S_IFMT);
+ (unsigned int) (pch_mode (reverse) & S_IFMT),
+ (unsigned int) (pch_mode (! reverse) & S_IFMT));
skip_rest_of_patch = true;
somefailed = true;
}
@@ -1817,9 +1817,9 @@ delete_files (void)
say ("Removing %s %s\n",
S_ISLNK (mode) ? "symbolic link" : "file",
quotearg (file_to_delete->name));
- move_file (0, 0, 0, file_to_delete->name, mode,
- file_to_delete->backup);
- removedirs (file_to_delete->name);
+ move_file (0, 0, 0, file_to_delete->name, mode,
+ file_to_delete->backup);
+ removedirs (file_to_delete->name);
}
}
gl_list_iterator_free (&iter);
diff --git a/src/safe.c b/src/safe.c
index d2ff0d2..5a7202f 100644
--- a/src/safe.c
+++ b/src/safe.c
@@ -243,6 +243,7 @@ out:
return entry;
}
+_GL_ATTRIBUTE_PURE
static unsigned int count_path_components (const char *path)
{
unsigned int components;
diff --git a/src/util.h b/src/util.h
index ab46540..f4936ec 100644
--- a/src/util.h
+++ b/src/util.h
@@ -68,7 +68,7 @@ enum file_id_type lookup_file_id (struct stat const *);
void set_queued_output (struct stat const *, bool);
bool has_queued_output (struct stat const *);
int stat_file (char const *, struct stat *);
-bool filename_is_safe (char const *);
+bool filename_is_safe (char const *) _GL_ATTRIBUTE_PURE;
bool cwd_is_root (char const *);
enum file_attributes {