View | Details | Raw Unified | Return to bug 16839
Collapse All | Expand All

(-)main.c (-2 / +21 lines)
Lines 41-46 Link Here
41
{
41
{
42
    int ch, error;
42
    int ch, error;
43
    char **pkgs, **start;
43
    char **pkgs, **start;
44
	char *pkgs_split;
44
45
45
    pkgs = start = argv;
46
    pkgs = start = argv;
46
    while ((ch = getopt(argc, argv, Options)) != -1)
47
    while ((ch = getopt(argc, argv, Options)) != -1)
Lines 82-89 Link Here
82
83
83
    /* Get all the remaining package names, if any */
84
    /* Get all the remaining package names, if any */
84
    /* Get all the remaining package names, if any */
85
    /* Get all the remaining package names, if any */
85
    while (*argv)
86
    while (*argv) {
86
	*pkgs++ = *argv++;
87
		if ((pkgs_split = rindex(*argv, (int)'/')) != NULL) {
88
			while (!isalpha(*(pkgs_split + 1))) {
89
				*pkgs_split = '\0';
90
				if ((pkgs_split = rindex(*argv, (int) '/')) == NULL)
91
				pkgs_split = *argv;
92
			}
93
			if (pkgs_split != NULL) {
94
				if (*pkgs_split == '/')
95
					pkgs_split++;
96
				*pkgs = pkgs_split;
97
				pkgs++;
98
			}
99
		}
100
		else {
101
			*pkgs = *argv;
102
			pkgs++;
103
		}
104
		argv++;
105
	}
87
106
88
    /* If no packages, yelp */
107
    /* If no packages, yelp */
89
    if (pkgs == start)
108
    if (pkgs == start)

Return to bug 16839