-/* $Id$ */
-
/* TESH (Test Shell) -- mini shell specialized in running test units */
-/* Copyright (c) 2007 Martin Quinson. */
-/* All rights reserved. */
+/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* Get args */
for (i = 1; i < argc; i++) {
- if (!strncmp(argv[i], "--cd", strlen("--cd") + 1)) {
+ if (!strcmp(argv[i], "--cd")) {
if (i == argc - 1) {
ERROR0("--cd argument requires an argument");
exit(1);
exit(1);
}
INFO1("Change directory to %s", argv[i + 1]);
- memmove(argv + i, argv + i + 2, argc - i - 1);
+ memmove(argv + i, argv + i + 2, (argc - i - 1)*sizeof(char*));
argc -= 2;
+ i -= 2;
}
}
}
rctx_exit();
- xbt_exit();
return 0;
}