* Simplified freeramdisk and added argument checking -- Pavel Roskin.
* Fixed segfault caused by "touch -c"
* Fixed segfault caused by "rm -f"
- * Fixed segfault caused by "ln -s -s" and similar abuses.
+ * Fixed segfault caused by "ln -s -s" and similar abuses. Further fixes
+ and "--" support from Pavel Roskin.
* Fixed segfault caused by "cp -a -a" and similar abuses.
* Implemented "rm -- <foo>". Implementation fixed by Pavel Roskin.
* "which" rewritten to use stat(). Fixes to improve its compatability
{
char *linkName;
int linkIntoDirFlag;
+ int stopIt = FALSE;
- if (argc < 3) {
- usage(ln_usage);
- }
argc--;
argv++;
/* Parse any options */
- while (--argc >= 0 && *argv && **argv) {
- while (**argv == '-') {
+ while (argc > 0 && stopIt == FALSE) {
+ if (**argv == '-') {
while (*++(*argv))
switch (**argv) {
case 's':
case 'n':
followLinks = FALSE;
break;
+ case '-':
+ stopIt = TRUE;
+ break;
default:
usage(ln_usage);
}
+ argc--;
+ argv++;
}
- argv++;
+ else
+ break;
}
- if (argc < 1) {
- fatalError("ln: missing file argument\n");
+ if (argc < 2) {
+ usage(ln_usage);
}
linkName = argv[argc - 1];
{
char *linkName;
int linkIntoDirFlag;
+ int stopIt = FALSE;
- if (argc < 3) {
- usage(ln_usage);
- }
argc--;
argv++;
/* Parse any options */
- while (--argc >= 0 && *argv && **argv) {
- while (**argv == '-') {
+ while (argc > 0 && stopIt == FALSE) {
+ if (**argv == '-') {
while (*++(*argv))
switch (**argv) {
case 's':
case 'n':
followLinks = FALSE;
break;
+ case '-':
+ stopIt = TRUE;
+ break;
default:
usage(ln_usage);
}
+ argc--;
+ argv++;
}
- argv++;
+ else
+ break;
}
- if (argc < 1) {
- fatalError("ln: missing file argument\n");
+ if (argc < 2) {
+ usage(ln_usage);
}
linkName = argv[argc - 1];