A NOTE has been added to this issue. ====================================================================== http://austingroupbugs.net/view.php?id=1255 ====================================================================== Reported By: stephane Assigned To: ====================================================================== Project: 1003.1(2016)/Issue7+TC2 Issue ID: 1255 Category: System Interfaces Type: Enhancement Request Severity: Objection Priority: normal Status: New Name: Stephane Chazelas Organization: User Reference: Section: glob(), EXAMPLES section Page Number: 1111 (in the 2018 edition) Line Number: 37598 Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2019-06-08 12:31 UTC Last Modified: 2019-07-18 16:18 UTC ====================================================================== Summary: improper shell code in glob() example ======================================================================
---------------------------------------------------------------------- (0004487) geoffclare (manager) - 2019-07-18 16:18 http://austingroupbugs.net/view.php?id=1255#c4487 ---------------------------------------------------------------------- On page 1111 line 37598,37600 section glob(), change:<pre> ls -l *.c</pre>to:<pre> ls -ld -- *.c</pre> On page 1111 line 37609 section glob(), change:<pre> ls -l *.c *.h</pre>to:<pre> ls -ld -- *.c *.h</pre> On page 1111 line 37601 section glob(), change: The application could obtain approximately the same result using the sequence: to: The application could obtain the same result (except for error handling, omitted here for simplicity) using the sequence: Change the first example (lines 37603-37606) to:<pre> globbuf.gl_offs = 3; glob("*.c", GLOB_DOOFFS|GLOB_NOCHECK|GLOB_ERR, NULL, &globbuf); globbuf.gl_pathv[0] = "ls"; globbuf.gl_pathv[1] = "-ld"; globbuf.gl_pathv[2] = "--"; // to establish the initial arguments that sh -c "ls -ld --" would produce for both examples</pre>The second (lines 37610-37614) to: could be simulated using GLOB_APPEND as follows:<pre> globbuf.gl_offs = 3; glob("*.c", GLOB_DOOFFS|GLOB_NOCHECK|GLOB_ERR, NULL, &globbuf); glob("*.h", GLOB_DOOFFS|GLOB_NOCHECK|GLOB_ERR|GLOB_APPEND, NULL, &globbuf); ... </pre> Issue History Date Modified Username Field Change ====================================================================== 2019-06-08 12:31 stephane New Issue 2019-06-08 12:31 stephane Name => Stephane Chazelas 2019-06-08 12:31 stephane Section => glob(), EXAMPLES section 2019-06-08 12:31 stephane Page Number => 1111 (in the 2018 edition) 2019-06-08 12:31 stephane Line Number => 37598 2019-07-18 12:08 geoffclare Note Added: 0004486 2019-07-18 16:18 geoffclare Note Added: 0004487 ======================================================================
