[Pkg-shadow-commits] r3362 - in upstream/trunk: . libmisc
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Thu Jun 16 21:25:36 UTC 2011
Author: nekral-guest
Date: 2011-06-16 21:25:36 +0000 (Thu, 16 Jun 2011)
New Revision: 3362
Modified:
upstream/trunk/ChangeLog
upstream/trunk/libmisc/env.c
upstream/trunk/libmisc/isexpired.c
Log:
* libmisc/isexpired.c: Added parenthesis.
* libmisc/env.c: Added comments.
* libmisc/env.c: Avoid implicit conversion of pointer to boolean.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2011-06-16 21:21:29 UTC (rev 3361)
+++ upstream/trunk/ChangeLog 2011-06-16 21:25:36 UTC (rev 3362)
@@ -1,5 +1,11 @@
2011-06-16 Nicolas François <nicolas.francois at centraliens.net>
+ * libmisc/isexpired.c: Added parenthesis.
+ * libmisc/env.c: Added comments.
+ * libmisc/env.c: Avoid implicit conversion of pointer to boolean.
+
+2011-06-16 Nicolas François <nicolas.francois at centraliens.net>
+
* src/su.c: environ is provided by <unistd.h>.
* src/su.c: Added function prototypes.
* src/su.c: Rename shellstr parameter to shellname to avoid
Modified: upstream/trunk/libmisc/env.c
===================================================================
--- upstream/trunk/libmisc/env.c 2011-06-16 21:21:29 UTC (rev 3361)
+++ upstream/trunk/libmisc/env.c 2011-06-16 21:25:36 UTC (rev 3362)
@@ -115,6 +115,9 @@
n = (size_t) (cp - newstring);
+ /*
+ * If this environment variable is already set, change its value.
+ */
for (i = 0; i < newenvc; i++) {
if ( (strncmp (newstring, newenvp[i], n) == 0)
&& (('=' == newenvp[i][n]) || ('\0' == newenvp[i][n]))) {
@@ -128,9 +131,16 @@
return;
}
+ /*
+ * Otherwise, save the new environment variable
+ */
newenvp[newenvc++] = newstring;
/*
+ * And extend the environment if needed.
+ */
+
+ /*
* Check whether newenvc is a multiple of NEWENVP_STEP.
* If so we have to resize the vector.
* the expression (newenvc & (NEWENVP_STEP - 1)) == 0
@@ -143,14 +153,14 @@
size_t newsize;
/*
- * If the resize operation succeds we can
+ * If the resize operation succeeds we can
* happily go on, else print a message.
*/
newsize = (newenvc + NEWENVP_STEP) * sizeof (char *);
__newenvp = (char **) realloc (newenvp, newsize);
- if (__newenvp) {
+ if (NULL != __newenvp) {
/*
* If this is our current environment, update
* environ so that it doesn't point to some
Modified: upstream/trunk/libmisc/isexpired.c
===================================================================
--- upstream/trunk/libmisc/isexpired.c 2011-06-16 21:21:29 UTC (rev 3361)
+++ upstream/trunk/libmisc/isexpired.c 2011-06-16 21:25:36 UTC (rev 3362)
@@ -107,7 +107,7 @@
if ( (-1 == sp->sp_lstchg)
|| (-1 == sp->sp_max)
- || (sp->sp_max >= (10000L * DAY / SCALE))) {
+ || (sp->sp_max >= ((10000L * DAY) / SCALE))) {
return 0;
}
More information about the Pkg-shadow-commits
mailing list