Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37506290
en ru br
Репозитории ALT
S:0.2-alt10
5.1: 0.2-alt9
4.1: 0.2-alt7
4.0: 0.2-alt7
+updates:0.2-alt7
3.0: 0.2-alt4
www.altlinux.org/Changes

Группа :: Работа с текстами
Пакет: ed

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: ed-0.2-alt-progname.patch
Скачать


--- ed-0.2/main.c.orig	2002-08-26 13:56:44 +0400
+++ ed-0.2/main.c	2002-08-26 13:57:43 +0400
@@ -105,7 +105,6 @@
 long err_status = 0;		/* program exit status */
 
 /* The name this program was run with. */
-char *program_name;
 
 /* If non-zero, display usage information and exit.  */
 int show_help = 0;
@@ -136,10 +135,10 @@
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
+    fprintf (stderr, "Try `%s --help' for more information.\n", program_invocation_short_name);
   else
     {
-      printf ("Usage: %s [OPTION]... [FILE]\n", program_name);
+      printf ("Usage: %s [OPTION]... [FILE]\n", program_invocation_short_name);
       printf ("\
 \n\
   -G, --traditional          use a few backward compatible features\n\
@@ -165,7 +164,9 @@
   int c, n;
   long status = 0;
 
-  program_name = argv[0];
+  if (argc < 1)
+    usage (1);
+
   red = (n = strlen (argv[0])) > 2 && argv[0][n - 3] == 'r';
 top:
   while ((c = getopt_long (argc, argv, "Gp:s", long_options, NULL)) != EOF)
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin