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

Last change on this file since 3111 was 3111, checked in by bruno, 6 years ago
  • revert patch 3106-2107 from SVK which had removed good code and fixes !!
  • Property svn:eol-style set to native
File size: 718 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 "mr_str.h"
9
10const char **strl = {
11        "test with space",
12        "test with \ backslash",
13        "test with \" doublequote",
14        "test with ' simplequote",
15        "test with ~ tilde",
16        "test with ? questionmark",
17        "test with ! exclammark",
18        "test with & ampersand",
19        "test with * star",
20        "test with | pipe",
21};
22// Number of strings
23const int MAX = 10;
24
25void main() {
26
27        char *p;
28        int i;
29
30        for (i = 1; i <= MAX ; i++) {
31                p = mr_stresc(strl[i], "`$\\\"(){}'[]&*?|!#~", '\\');
32                printf("Original chain is %s\n",strl[i]);
33                printf("Transformed chain is %s\n",p);
34        }
35exit(0);
36}
Note: See TracBrowser for help on using the repository browser.