diff --git a/tests/test_args b/tests/test_args new file mode 100755 index 0000000..353c16c Binary files /dev/null and b/tests/test_args differ diff --git a/tests/test_args.c b/tests/test_args.c new file mode 100644 index 0000000..9e7e00f --- /dev/null +++ b/tests/test_args.c @@ -0,0 +1,36 @@ +/* + ============================================================================ + Name : test_args.c + Author : martin.dvorak@midforger.com + Copyright : Apache 2.0 + Description : A test + ============================================================================ +*/ + +#include +#include + +#define LINELNG 500 + +int main(int argc, char *argv[]) +{ + if(argc>0) { + int i; + char line[LINELNG]; + line[0]=0; + for(i=0; iLINELNG) break; + printf("%d %s\n", i, argv[i]); + if(strstr(argv[i], " ")) { + strcat(line, "\""); + } + strcat(line, argv[i]); + if(strstr(argv[i], " ")) { + strcat(line, "\""); + } + strcat(line, " "); + } + + printf("#%s#", line); + } +} diff --git a/tests/test_args.sh b/tests/test_args.sh new file mode 100755 index 0000000..07059dd --- /dev/null +++ b/tests/test_args.sh @@ -0,0 +1 @@ +gcc test_args.c -o test_args