summaryrefslogtreecommitdiff
path: root/legacy/evil
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2009-12-19 19:08:28 +0000
committerVincent Torri <vincent.torri@gmail.com>2009-12-19 19:08:28 +0000
commit8e9e67f075b049f944e5d77717bda0d333160ebc (patch)
tree7e0240abbef7e581649bd6578cb51d9ba2ec70c7 /legacy/evil
parentbca91fb4c2d3381352ce0f018cf95cbff7892b26 (diff)
* Makefile.am:
remove m4 libtool installed files during the maintainer-clean rule * src/lib/evil_stdio.c: * src/lib/evil_stdio.h: add the remove() function SVN revision: 44577
Diffstat (limited to 'legacy/evil')
-rw-r--r--legacy/evil/ChangeLog10
-rw-r--r--legacy/evil/Makefile.am7
-rw-r--r--legacy/evil/src/lib/evil_stdio.c21
-rw-r--r--legacy/evil/src/lib/evil_stdio.h4
4 files changed, 41 insertions, 1 deletions
diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog
index 949733c2cb..8940911236 100644
--- a/legacy/evil/ChangeLog
+++ b/legacy/evil/ChangeLog
@@ -1,3 +1,13 @@
12009-12-19 Vincent Torri <doursse at users dot sf dot net>
2
3 * Makefile.am:
4 remove m4 libtool installed files during the
5 maintainer-clean rule
6
7 * src/lib/evil_stdio.c:
8 * src/lib/evil_stdio.h:
9 add the remove() function
10
12009-12-11 Vincent Torri <doursse at users dot sf dot net> 112009-12-11 Vincent Torri <doursse at users dot sf dot net>
2 12
3 * configure.ac: 13 * configure.ac:
diff --git a/legacy/evil/Makefile.am b/legacy/evil/Makefile.am
index 8f6467b8b1..c0f86bc697 100644
--- a/legacy/evil/Makefile.am
+++ b/legacy/evil/Makefile.am
@@ -15,7 +15,12 @@ ltmain.sh \
15Makefile.in \ 15Makefile.in \
16missing \ 16missing \
17mkinstalldirs \ 17mkinstalldirs \
18$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)* 18$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)* \
19m4/libtool.m4 \
20m4/lt~obsolete.m4 \
21m4/ltoptions.m4 \
22m4/ltsugar.m4 \
23m4/ltversion.m4
19 24
20SUBDIRS = src doc 25SUBDIRS = src doc
21 26
diff --git a/legacy/evil/src/lib/evil_stdio.c b/legacy/evil/src/lib/evil_stdio.c
index 78ddc17a56..445b63f866 100644
--- a/legacy/evil/src/lib/evil_stdio.c
+++ b/legacy/evil/src/lib/evil_stdio.c
@@ -77,6 +77,27 @@ void evil_rewind(FILE *stream)
77 fseek(stream, 0, SEEK_SET); 77 fseek(stream, 0, SEEK_SET);
78} 78}
79 79
80int evil_remove(const char *path)
81{
82 struct stat st;
83
84 if (stat(path, &st) < 0) return -1;
85
86 if (S_ISDIR(st.st_mode))
87 {
88 if (rmdir(path) < 0) return -1;
89 return 0;
90 }
91
92 if (S_ISREG(st.st_mode))
93 {
94 if (unlink(path) < 0) return -1;
95 return 0;
96 }
97
98 return -1;
99}
100
80 101
81#endif /* _WIN32_WCE && ! __CEGCC__ */ 102#endif /* _WIN32_WCE && ! __CEGCC__ */
82 103
diff --git a/legacy/evil/src/lib/evil_stdio.h b/legacy/evil/src/lib/evil_stdio.h
index 686c1b16ad..76f6f8fa73 100644
--- a/legacy/evil/src/lib/evil_stdio.h
+++ b/legacy/evil/src/lib/evil_stdio.h
@@ -35,6 +35,10 @@ EAPI void evil_rewind(FILE *stream);
35 35
36# define rewind(f) evil_rewind(f) 36# define rewind(f) evil_rewind(f)
37 37
38EAPI int evil_remove(const char *path);
39
40# define remove(p) evil_remove(p)
41
38#endif /* _WIN32_WCE && ! __CEGCC__ */ 42#endif /* _WIN32_WCE && ! __CEGCC__ */
39 43
40 44