From 5e9520c87752aaf3f7920cc231ca50245c364a38 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 5 Nov 2001 16:20:37 +0000 Subject: [PATCH] * arlex.l: Accept `\' in filenames. Patch by . * arsup.c (ar_open): Prepend tmp- to basename, not whole path. --- binutils/ChangeLog | 6 ++++++ binutils/arlex.l | 2 +- binutils/arsup.c | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 11f2b7832a3..bc8fc5788e4 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2001-11-05 Jakub Jelinek + + * arlex.l: Accept `\' in filenames. Patch by . + + * arsup.c (ar_open): Prepend tmp- to basename, not whole path. + 2001-11-05 Martin Schwidefsky * MAINTAINERS: Add self as s390/s390x maintainer. diff --git a/binutils/arlex.l b/binutils/arlex.l index 71ef56ee6f9..4e2895cdc9c 100644 --- a/binutils/arlex.l +++ b/binutils/arlex.l @@ -71,7 +71,7 @@ int linenumber; "(" { return '('; } ")" { return ')'; } "," { return ','; } -[A-Za-z0-9/$:.\-\_]+ { +[A-Za-z0-9/\\$:.\-\_]+ { yylval.name = xstrdup (yytext); return FILENAME; } diff --git a/binutils/arsup.c b/binutils/arsup.c index 0058c0d31f5..1e864793955 100644 --- a/binutils/arsup.c +++ b/binutils/arsup.c @@ -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) { -- 2.30.2