diff options
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r-- | gcc/java/jcf-parse.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 1a2de9e..2fe97bc 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -333,7 +333,7 @@ set_source_filename (JCF *jcf, int index) { const char *class_name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))); - char *dot = strrchr (class_name, '.'); + const char *dot = strrchr (class_name, '.'); if (dot != NULL) { /* Length of prefix, not counting final dot. */ @@ -1355,7 +1355,7 @@ load_class (tree class_or_name, int verbose) { while (1) { - char *separator; + const char *separator; /* We've already loaded it. */ if (IDENTIFIER_CLASS_VALUE (name) != NULL_TREE) @@ -1372,12 +1372,9 @@ load_class (tree class_or_name, int verbose) for an inner class. */ if ((separator = strrchr (IDENTIFIER_POINTER (name), '$')) || (separator = strrchr (IDENTIFIER_POINTER (name), '.'))) - { - int c = *separator; - *separator = '\0'; - name = get_identifier (IDENTIFIER_POINTER (name)); - *separator = c; - } + name = get_identifier_with_length (IDENTIFIER_POINTER (name), + (separator + - IDENTIFIER_POINTER (name))); /* Otherwise, we failed, we bail. */ else break; |