• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


コミットメタ情報

リビジョン29d8ba014e5374bb2a0f1106da18fde651a4b8d1 (tree)
日時2006-11-09 02:45:23
作者Vladimir Prus <vladimir@code...>
コミッターVladimir Prus

ログメッセージ

2006-11-08 Vladimir Prus <vladimir@codesourcery.com>

        • pex-win32.c (no_suffixes): Remove.
          (std_suffixes): Add "" as first element.
          (find_executable): Remove detection of already-present
        1. Try all suffixes in std_suffixes.

変更サマリ

差分

--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,3 +1,10 @@
1+2006-11-08 Vladimir Prus <vladimir@codesourcery.com>
2+
3+ * pex-win32.c (no_suffixes): Remove.
4+ (std_suffixes): Add "" as first element.
5+ (find_executable): Remove detection of already-present
6+ extension. Try all suffixes in std_suffixes.
7+
18 2006-11-07 Vladimir Prus <vladimir@codesourcery.com>
29
310 * testsuite/ld-elf/symbol2w.s: Use "%" instead
--- a/libiberty/pex-win32.c
+++ b/libiberty/pex-win32.c
@@ -382,16 +382,18 @@ argv_to_cmdline (char *const *argv)
382382 return cmdline;
383383 }
384384
385+/* We'll try the passed filename with all the known standard
386+ extensions, and then without extension. We try no extension
387+ last so that we don't try to run some random extension-less
388+ file that might be hanging around. We try both extension
389+ and no extension so that we don't need any fancy logic
390+ to determine if a file has extension. */
385391 static const char *const
386392 std_suffixes[] = {
387393 ".com",
388394 ".exe",
389395 ".bat",
390396 ".cmd",
391- 0
392-};
393-static const char *const
394-no_suffixes[] = {
395397 "",
396398 0
397399 };
@@ -409,7 +411,6 @@ find_executable (const char *program, BOOL search)
409411 const char *const *ext;
410412 const char *p, *q;
411413 size_t proglen = strlen (program);
412- int has_extension = !!strchr (program, '.');
413414 int has_slash = (strchr (program, '/') || strchr (program, '\\'));
414415 HANDLE h;
415416
@@ -432,7 +433,7 @@ find_executable (const char *program, BOOL search)
432433 if (*q == ';')
433434 q++;
434435 }
435- fe_len = fe_len + 1 + proglen + (has_extension ? 1 : 5);
436+ fe_len = fe_len + 1 + proglen + 5 /* space for extension */;
436437 full_executable = xmalloc (fe_len);
437438
438439 p = path;
@@ -458,7 +459,7 @@ find_executable (const char *program, BOOL search)
458459
459460 /* At this point, e points to the terminating NUL character for
460461 full_executable. */
461- for (ext = has_extension ? no_suffixes : std_suffixes; *ext; ext++)
462+ for (ext = std_suffixes; *ext; ext++)
462463 {
463464 /* Remove any current extension. */
464465 *e = '\0';