aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Bothner <bothner@cygnus.com>1998-01-28 11:46:37 +0000
committerPer Bothner <bothner@gcc.gnu.org>1998-01-28 03:46:37 -0800
commit2290e0ece46030d74e8fb6bc67f421fb08186d57 (patch)
tree20f234281837d116d2283bd399d33e002a2d8fa6
parent86052cc3d8e276609904697ebb3db98cf67c5e11 (diff)
downloadgcc-2290e0ece46030d74e8fb6bc67f421fb08186d57.zip
gcc-2290e0ece46030d74e8fb6bc67f421fb08186d57.tar.gz
gcc-2290e0ece46030d74e8fb6bc67f421fb08186d57.tar.bz2
*** empty log message ***
From-SVN: r17532
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/toplev.c19
2 files changed, 15 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 011caf3..2b0c5fa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+Wed Jan 28 11:45:27 1998 Per Bothner <bothner@cygnus.com>
+
+ * toplev.c (strip_off_ending): Generalize to endings up to 5 chars.
+
Tue Jan 27 23:15:55 1998 Lassi A. Tuura <lat@iki.fi>
* config.sub: More accurate determination of HP processor types.
diff --git a/gcc/toplev.c b/gcc/toplev.c
index f7b659e..39c80ba 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2080,20 +2080,23 @@ pipe_closed (signo)
/* Strip off a legitimate source ending from the input string NAME of
length LEN. Rather than having to know the names used by all of
- our front ends, we strip off an ending of a period followed by one,
- two, or three characters. */
+ our front ends, we strip off an ending of a period followed by
+ up to five characters. (Java uses ".class".) */
void
strip_off_ending (name, len)
char *name;
int len;
{
- if (len > 2 && name[len - 2] == '.')
- name[len - 2] = '\0';
- else if (len > 3 && name[len - 3] == '.')
- name[len - 3] = '\0';
- else if (len > 4 && name[len - 4] == '.')
- name[len - 4] = '\0';
+ int i;
+ for (i = 2; i < 6 && len > i; i++)
+ {
+ if (name[len - i] == '.')
+ {
+ name[len - i] = '\0';
+ break;
+ }
+ }
}
/* Output a quoted string. */