<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/env.c, branch v9.0</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v9.0</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v9.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2021-07-26T07:59:36Z</updated>
<entry>
<title>env: fix usage typo</title>
<updated>2021-07-26T07:59:36Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2021-07-17T20:07:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=3753c706b7ccd756db955e850175b79f22911d57'/>
<id>urn:sha1:3753c706b7ccd756db955e850175b79f22911d57</id>
<content type='text'>
* src/env.c (usage): Fix pluralization typo.
</content>
</entry>
<entry>
<title>maint: use "char const *" rather than "const char *"</title>
<updated>2021-04-11T17:33:45Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-04-11T17:23:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=ef772bf97f7ec577754cbb5b278504d83cf41a43'/>
<id>urn:sha1:ef772bf97f7ec577754cbb5b278504d83cf41a43</id>
<content type='text'>
* cfg.mk (sc_prohibit-const-char): Add a new syntax-check to
enforce this style.
* *.[ch]: sed -i 's/const char \*/char const */g'
</content>
</entry>
<entry>
<title>env: simplify --split-string memory management</title>
<updated>2021-03-30T04:44:58Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2021-03-30T04:42:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=e3766c5db176ca7abbb8212d5b0b7862fb98a5be'/>
<id>urn:sha1:e3766c5db176ca7abbb8212d5b0b7862fb98a5be</id>
<content type='text'>
* bootstrap.conf (gnulib_modules): Add idx.
* src/env.c: Include idx.h, minmax.h.
Prefer idx_t to ptrdiff_t when values are nonnegative.
(valid_escape_sequence, escape_char, validate_split_str)
(CHECK_START_NEW_ARG):
Remove; no longer needed now that we validate as we go.
(struct splitbuf): New type.
(splitbuf_grow, splitbuf_append_byte, check_start_new_arg)
(splitbuf_finishup): New functions.
(build_argv): New arg ARGC.  Validate and process in one go, using
the new functions; this is simpler and more reliable than the old
approach (as witness the recent bug).  Avoid integer overflow in
the unlikely case where the string contains more than INT_MAX
arguments.
(parse_split_string): Simplify by exploiting the new build_argv.
</content>
</entry>
<entry>
<title>env: prefer ptrdiff_t</title>
<updated>2021-03-26T22:17:28Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2021-03-26T21:56:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=12abdb757abb79a6be4843174898868f8dd0f24c'/>
<id>urn:sha1:12abdb757abb79a6be4843174898868f8dd0f24c</id>
<content type='text'>
* src/env.c (usvars_used, vnlen, unset_envvars, expansion)
(build_argv): Prefer ptrdiff_t to size_t when either will do.
</content>
</entry>
<entry>
<title>env: improve whitespace warning</title>
<updated>2021-03-26T22:17:28Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2021-03-26T21:51:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5f99c7533df49f25819d7bb850be5c6cb49aa13d'/>
<id>urn:sha1:5f99c7533df49f25819d7bb850be5c6cb49aa13d</id>
<content type='text'>
* src/env.c (main): Issue -S warning for any whitespace,
not just space.
</content>
</entry>
<entry>
<title>env: use GNU coding style</title>
<updated>2021-03-26T22:17:28Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2021-03-26T21:47:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=7fc887299ef482001524e846aee12acf0659e1be'/>
<id>urn:sha1:7fc887299ef482001524e846aee12acf0659e1be</id>
<content type='text'>
* src/env.c: Use GNU coding style for recentish changes.
</content>
</entry>
<entry>
<title>env: remove asserts</title>
<updated>2021-03-26T22:17:28Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2021-03-26T21:06:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=52f11d8b7ce886fd85b933eac58a62ee90ec63ce'/>
<id>urn:sha1:52f11d8b7ce886fd85b933eac58a62ee90ec63ce</id>
<content type='text'>
The assertions didn’t help catch the most recent bug which
was in their area, and kind of get in the way.
* src/env.c: Do not include &lt;assert.h&gt;, and remove all assertions.
These seem to have been put in to pacify gcov, but surely there’s
a better way.
(escape_char): Pacify GCC with 'assume' instead.
</content>
</entry>
<entry>
<title>env: fix address violation with '\v' in -S</title>
<updated>2021-03-26T20:50:16Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2021-03-26T20:49:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=ec6904f0ed55c1796592a33c49aebf47eb5fc6c3'/>
<id>urn:sha1:ec6904f0ed55c1796592a33c49aebf47eb5fc6c3</id>
<content type='text'>
Problem reported by Frank Busse (Bug#47412).
* src/env.c (C_ISSPACE_CHARS): New macro.
(shortopts, build_argv, main): Treate all C-locale space
characters like space and tab, for compatibility with FreeBSD.
(validate_split_str, build_argv, parse_split_string):
Use the C locale, not the current locale, to determine whether a
byte is a space character.
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2021-01-01T16:36:09Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-01-01T16:36:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=32ff1d1313ff566685b9092ac929251a4c22e7c4'/>
<id>urn:sha1:32ff1d1313ff566685b9092ac929251a4c22e7c4</id>
<content type='text'>
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
</content>
</entry>
<entry>
<title>maint: avoid warnings from GCC's -fanalyzer</title>
<updated>2020-05-11T20:18:47Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2020-05-10T13:22:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=c7194b43fca6f58e66435e4d089e5a9ea15673ab'/>
<id>urn:sha1:c7194b43fca6f58e66435e4d089e5a9ea15673ab</id>
<content type='text'>
* src/env.c (build_argv): Add an assert() to avoid:
  warning: use of NULL 'n' where non-null expected
  [CWE-690] [-Wanalyzer-null-argument]
  note: argument 1 of 'getenv' must be non-null
* src/dd.c (alloc_ibuf): Don't discard the allocated pointer, to avoid:
  [CWE-401] [-Wanalyzer-malloc-leak]
(alloc_obuf): Likewise.
(cleanup): Deallocate the now tracked buffers which
also avoids "possibly lost" warnings from valgrind.
* src/tsort.c (search_item): Add asserts to avoid:
  [CWE-690] [-Wanalyzer-null-dereference]
(record_relation): An assert doesn't suffice here,
so disable the warning for this function.
* src/comm.c: Suppress the following false positive for the whole file:
  [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
* src/chown-core.c: Suppress the following false positive for the file:
  [CWE-415] [-Wanalyzer-double-free]
</content>
</entry>
</feed>
