summaryrefslogtreecommitdiff
path: root/gcc/cccp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cccp.c')
-rw-r--r--gcc/cccp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index c394ea2ecc2..f8877be99df 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -9814,7 +9814,7 @@ new_include_prefix (prev_file_name, component, prefix, name)
len = simplify_filename (dir->fname);
/* Convert directory name to a prefix. */
- if (dir->fname[len - 1] != DIR_SEPARATOR) {
+ if (len && dir->fname[len - 1] != DIR_SEPARATOR) {
if (len == 1 && dir->fname[len - 1] == '.')
len = 0;
else