Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37708312
en ru br
Репозитории ALT
S:1.18-alt1
5.1: 1.14-alt4
4.1: 1.14-alt2
4.0: 1.7-alt16
3.0: 1.7-alt13
www.altlinux.org/Changes

Группа :: Система/Библиотеки
Пакет: libpopt

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

Патч: popt-20020315-alt-poptBadOption.patch
Скачать


--- popt-20020315/popt.c.orig	2004-05-20 21:19:18 +0400
+++ popt-20020315/popt.c	2004-05-21 15:11:15 +0400
@@ -1136,14 +1136,19 @@
 
 const char * poptBadOption(poptContext con, int flags)
 {
-    struct optionStackEntry * os = NULL;
+    struct optionStackEntry *os;
 
-    if (con != NULL)
-	os = (flags & POPT_BADOPTION_NOALIAS) ? con->optionStack : con->os;
+    if (!con)
+	return NULL;
 
-    /*@-nullderef@*/	/* LCL: os->argv != NULL */
-    return (os && os->argv ? os->argv[os->next - 1] : NULL);
-    /*@=nullderef@*/
+    os = (flags & POPT_BADOPTION_NOALIAS) ? con->optionStack : con->os;
+    if (!os)
+	return NULL;
+
+    if (con->doExec && con->doExec->argv && !os->nextCharArg && os->next == os->argc)
+    	return con->doExec->argv[0];
+
+    return ((os->argv && (os->next > 0)) ? os->argv[os->next - 1] : NULL);
 }
 
 const char *const poptStrerror(const int error)
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin