aboutsummaryrefslogtreecommitdiff
path: root/tests/pushck.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-10 23:12:02 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-05-11 00:28:52 +0300
commitdb81e378576dcc5510032c72060e48e562f208c9 (patch)
tree914c5f277a5fad050527a5c5da815f521e8023dc /tests/pushck.c
parent84db86f0151385a8f05483bf691fde86b4e4e153 (diff)
downloadwydawca-db81e378576dcc5510032c72060e48e562f208c9.tar.gz
wydawca-db81e378576dcc5510032c72060e48e562f208c9.tar.bz2
Remove save-cwd.
* src/pushd.c: New file. * src/Makefile.am: Add pushd.c * src/wydawca.h (push_dir, pop_dir): New functions. * src/diskio.c: Use push_dir/pop_dir. * src/exec.c: Likewise. * src/gpg.c: Likewise. * gnulib.modules: Remove save-cwd. * tests/pushck.c: New file. * tests/pushdir.at: New file. * tests/testsuite.at: Add pushdir.at * tests/Makefile.am: Likewise. * tests/.gitignore: Add pushck.
Diffstat (limited to 'tests/pushck.c')
-rw-r--r--tests/pushck.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/pushck.c b/tests/pushck.c
new file mode 100644
index 0000000..f94cbf7
--- /dev/null
+++ b/tests/pushck.c
@@ -0,0 +1,34 @@
+#include <config.h>
+#include <wydawca.h>
+
+static void
+printcwd (int c)
+{
+ char *dir = getcwd_alloc ();
+ printf ("%c%s\n", c, dir);
+ free (dir);
+}
+
+int
+main (int argc, char **argv)
+{
+ while (--argc)
+ {
+ char *dir = *++argv;
+ if (push_dir (dir))
+ {
+ perror (dir);
+ abort ();
+ }
+ printcwd ('+');
+ }
+
+ do
+ {
+ printcwd ('-');
+ }
+ while (pop_dir() == 0);
+ exit(0);
+}
+
+ /*===============*/

Return to:

Send suggestions and report system problems to the System administrator.