Index: b/sed/execute.c
===================================================================
--- a/sed/execute.c
+++ b/sed/execute.c
@@ -569,7 +569,7 @@ open_next_file(const char *name, struct
       if (follow_symlinks)
         input->in_file_name = follow_symlink (name);
 
-      if ( ! (input->fp = ck_fopen (name, read_mode, false)) )
+      if ( ! (input->fp = ck_fopen (input->in_file_name, read_mode, false)) )
         {
           const char *ptr = strerror (errno);
           fprintf (stderr, _("%s: can't read %s: %s\n"), myname, name, ptr);
