5 int main(int ac, char *av[]) {
13 /* If string is a null string, it is unspecified whether the resulting
14 * string is '.' or a null string. In either case, skip steps 2 through
23 * If string consists entirely of <slash> characters, string shall be
24 * set to a single <slash> character. In this case, skip steps 4 to 6.
36 /* If there are any trailing <slash> characters in string, they shall
38 for (t = s+len-1; t > s; t--) {
46 /* If there are any <slash> characters remaining in string, the prefix
47 * of string up to and including the last <slash> character in string
48 * shall be removed. */
49 for (t=s+len-1; t > s; t--) {
57 /* If the suffix operand is present, is not identical to the characters
58 * remaining in string, and is identical to a suffix of the characters
59 * remaining in string, the suffix suffix shall be removed from string.
60 * Otherwise, string is not modified by this step. It shall not be
61 * considered an error if suffix is not found in string.
65 suflen = strlen(av[2]);
66 if (suflen <= len && !strcmp(av[2], s+len-suflen)) {