• R/O
  • SSH
  • HTTPS

yash: 提交


Commit MetaInfo

修訂4185 (tree)
時間2022-01-28 23:37:04
作者magicant

Log Message

Don't crash when invoked without any argv

Change Summary

差異

--- yash/trunk/NEWS (revision 4184)
+++ yash/trunk/NEWS (revision 4185)
@@ -15,6 +15,7 @@
1515 parsed correctly.
1616 * Fixed a bug where unclosed quotes in an end-of-here-document
1717 indicator were causing the shell to crash or misbehave.
18+ * Fixed a bug where yash crashes when invoked with no argv.
1819
1920 ----------------------------------------------------------------------
2021 Yash 2.52 (2021-10-11)
--- yash/trunk/yash.c (revision 4184)
+++ yash/trunk/yash.c (revision 4185)
@@ -1,6 +1,6 @@
11 /* Yash: yet another shell */
22 /* yash.c: basic functions of the shell */
3-/* (C) 2007-2020 magicant */
3+/* (C) 2007-2022 magicant */
44
55 /* This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
@@ -121,7 +121,7 @@
121121 wargv[argc] = NULL;
122122
123123 /* parse argv[0] */
124- yash_program_invocation_name = wargv[0];
124+ yash_program_invocation_name = wargv[0] != NULL ? wargv[0] : L"";
125125 yash_program_invocation_short_name
126126 = wcsrchr(yash_program_invocation_name, L'/');
127127 if (yash_program_invocation_short_name != NULL)
Show on old repository browser