summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2006-12-14 11:27:58 +0000
committerBernhard Reutner-Fischer2006-12-14 11:27:58 +0000
commit56b956952ec8bf6cd277a68107c1188e6b219b39 (patch)
treeb963999fc54eddb65f1929b894f868e24851fc9c
parentf7b0d4a3e5f06bd209f074f09c3a1431bf89f447 (diff)
downloadbusybox-56b956952ec8bf6cd277a68107c1188e6b219b39.zip
busybox-56b956952ec8bf6cd277a68107c1188e6b219b39.tar.gz
- minor shrinkage
-rw-r--r--coreutils/diff.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/coreutils/diff.c b/coreutils/diff.c
index 7a9f8c7..2ed26ba 100644
--- a/coreutils/diff.c
+++ b/coreutils/diff.c
@@ -1105,10 +1105,12 @@ static void diffdir(char *p1, char *p2)
/* Check for trailing slashes. */
- if (p1[strlen(p1) - 1] == '/')
- p1[strlen(p1) - 1] = '\0';
- if (p2[strlen(p2) - 1] == '/')
- p2[strlen(p2) - 1] = '\0';
+ dp1 = last_char_is(p1, '/');
+ if (dp1 != NULL)
+ *dp1 = '\0';
+ dp2 = last_char_is(p2, '/');
+ if (dp2 != NULL)
+ *dp2 = '\0';
/* Get directory listings for p1 and p2. */