Репозиторий Sisyphus
Последнее обновление: 15 октября 2021 | Пакетов: 17364 | Посещений: 22087268
en ru br
Репозитории ALT
S:1.0.8-alt2
5.1: 1.0.6-alt1
4.1: 1.0.6-alt0.M40.1
4.0: 1.0.6-alt0.M40.1
+updates:1.0.5-alt2
3.0: 1.0.3-alt5
www.altlinux.org/Changes

Группа :: Архивирование/Сжатие
Пакет: bzip2

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

Патч: bzip2-1.0.6-alt-progname.patch
Скачать


--- bzip2/bzip2.c
+++ bzip2/bzip2.c
@@ -209,8 +209,7 @@ Int32   longestFileName;
 Char    inName [FILE_NAME_LEN];
 Char    outName[FILE_NAME_LEN];
 Char    tmpName[FILE_NAME_LEN];
-Char    *progName;
-Char    progNameReally[FILE_NAME_LEN];
+const char    *progName;
 FILE    *outputHandleJustInCase;
 Int32   workFactor;
 
@@ -1795,7 +1794,6 @@ void addFlagsFromEnvVar ( Cell** argList, const Char* varName )
 IntNative main ( IntNative argc, Char *argv[] )
 {
    Int32  i, j;
-   Char   *tmp;
    Cell   *argList;
    Cell   *aa;
    Bool   decode;
@@ -1834,10 +1832,7 @@ IntNative main ( IntNative argc, Char *argv[] )
    copyFileName ( inName,  (Char*)"(none)" );
    copyFileName ( outName, (Char*)"(none)" );
 
-   copyFileName ( progNameReally, argv[0] );
-   progName = &progNameReally[0];
-   for (tmp = &progNameReally[0]; *tmp != '\0'; tmp++)
-      if (*tmp == PATH_SEP) progName = tmp + 1;
+   progName = program_invocation_short_name;
 
 
    /*-- Copy flags from env var BZIP2, and 
--- bzip2/bzip2recover.c
+++ bzip2/bzip2recover.c
@@ -75,7 +75,7 @@ typedef  unsigned char  Bool;
 
 Char inFileName[BZ_MAX_FILENAME];
 Char outFileName[BZ_MAX_FILENAME];
-Char progName[BZ_MAX_FILENAME];
+const char *progName;
 
 MaybeUInt64 bytesOut = 0;
 MaybeUInt64 bytesIn  = 0;
@@ -350,7 +350,7 @@ Int32 main ( Int32 argc, Char** argv )
    UInt32      buffHi, buffLo, blockCRC;
    Char*       p;
 
-   strcpy ( progName, argv[0] );
+   progName = program_invocation_short_name;
    inFileName[0] = outFileName[0] = 0;
 
    fprintf ( stderr, 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin