source: MondoRescue/branches/3.0/mondo/test/test-mr_stresc.c@ 3141

Last change on this file since 3141 was 3141, checked in by Bruno Cornec, 11 years ago

r5345@localhost: bruno | 2013-06-13 12:46:54 +0200

  • Solving #702 by adding a -F option which is meant to be used especially when mondoarchive is launched from cron, to avoid going into a loop where mondoarchive asks questions to the admin, where they cannot be answerd, which fills the logs and the underlying file system. With -F mondoarchive will exits at the first interaction request instead.
  • Property svn:eol-style set to native
File size: 878 bytes
Line 
1/*
2 * $Id$
3 *
4 * Test program for mr_stresc
5 * Can be used on host system with valgrind easier than with mondorestore
6 */
7#include <stdio.h>
8#include <stdlib.h>
9#include "mr_str.h"
10#include "my-stuff.h"
11
12/* Whether we should fail immediately at first error */
13bool g_fail_immediately = FALSE;
14
15void (*mr_cleanup)(void) = NULL;
16
17char *strl[] = {
18 "test with space",
19 "test with \ backslash",
20 "test with \" doublequote",
21 "test with ' simplequote",
22 "test with ~ tilde",
23 "test with ? questionmark",
24 "test with ! exclammark",
25 "test with & ampersand",
26 "test with * star",
27 "test with | pipe",
28};
29// Number of strings
30const int MAX = 10;
31
32int main() {
33
34 char *p;
35 int i;
36
37 for (i = 1; i <= MAX ; i++) {
38 p = mr_stresc(strl[i], "`$\\\"(){}'[]&*?|!#~", '\\');
39 printf("Original chain is %s\n",strl[i]);
40 printf("Transformed chain is %s\n",p);
41 }
42exit(0);
43}
Note: See TracBrowser for help on using the repository browser.