]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - binutils/arsup.c
* arlex.l: Accept `\' in filenames. Patch by <earl_chew@agilent.com>.
[thirdparty/binutils-gdb.git] / binutils / arsup.c
index 0058c0d31f566ccf388fe7d253ebbfebd7bcebae..1e864793955ff9ce5dda92765a09f6bedebaf6e2 100644 (file)
@@ -160,10 +160,11 @@ DEFUN(ar_open,(name, t),
 
 {
   char *tname = (char *) xmalloc (strlen (name) + 10);
+  const char *bname = lbasename (name);
   real_name = name;
   /* Prepend tmp- to the beginning, to avoid file-name clashes after
      truncation on filesystems with limited namespaces (DOS).  */
-  sprintf(tname, "tmp-%s", name);
+  sprintf(tname, "%.*stmp-%s", (int) (bname - name), name, bname);
   obfd = bfd_openw(tname, NULL);
 
   if (!obfd) {