Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37044686
en ru br
ALT Linux repositórios
S:1.18-alt1
5.0: 1.14-alt4
4.1: 1.14-alt2
4.0: 1.7-alt16
3.0: 1.7-alt13

Group :: Sistema/Bibliotecas
RPM: libpopt

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: popt-1.14-alt-poptBadOption.patch
Download


--- a/popt/popt.c
+++ b/popt/popt.c
@@ -1351,12 +1351,19 @@ int poptAddItem(poptContext con, poptItem newItem, int flags)
 
 const char * poptBadOption(poptContext con, unsigned 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;
+
+    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 != NULL && os->argv != NULL ? os->argv[os->next - 1] : NULL);
+    return ((os->argv && (os->next > 0)) ? os->argv[os->next - 1] : NULL);
 }
 
 const char * poptStrerror(const int error)
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009