diff options
author | Roland McGrath <roland@redhat.com> | 1996-06-22 19:26:13 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 1996-06-22 19:26:13 +0000 |
commit | 783e6680b2b953a39ba2a94fb746439cbf5dc368 (patch) | |
tree | a5b056b8fdc08657763ab5111a7d0179e88eb671 | |
parent | 2529deb2bfd38d1e0807c2deded79ebc6fdcc8be (diff) | |
download | make-783e6680b2b953a39ba2a94fb746439cbf5dc368.tar.gz |
Sat Jun 15 20:30:01 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* read.c (find_char_unquote): Avoid calling strlen on every call
just to throw away the value most of the time.
-rw-r--r-- | read.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1509,7 +1509,7 @@ find_char_unquote (string, stopchars, blank) char *stopchars; int blank; { - unsigned int string_len = strlen (string); + unsigned int string_len = 0; register char *p = string; while (1) @@ -1527,6 +1527,9 @@ find_char_unquote (string, stopchars, blank) while (&p[i] >= string && p[i] == '\\') --i; ++i; + /* Only compute the length if really needed. */ + if (string_len == 0) + string_len = strlen (string); /* The number of backslashes is now -I. Copy P over itself to swallow half of them. */ bcopy (&p[i / 2], &p[i], (string_len - (p - string)) - (i / 2) + 1); |