aboutsummaryrefslogtreecommitdiff
path: root/libps/fmt.c
Commit message (Collapse)AuthorAgeFilesLines
* Simplify deallocations.Justus Winter2017-08-051-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | free (NULL) is a nop, therefore it is not necessary to check that first. Simplify the code accordingly. This commit is the result of the following semantic patch: @@ identifier X; @@ -if (X) free (X); +free (X); * console-client/console.c: Simplify accordingly. * console-client/driver.c: Likewise. * console-client/vga.c: Likewise. * ftpfs/dir.c: Likewise. * libftpconn/unix.c: Likewise. * libps/fmt.c: Likewise. * libps/proclist.c: Likewise. * libstore/mvol.c: Likewise. * nfs/ops.c: Likewise. * proc/host.c: Likewise. * sutils/fstab.c: Likewise.
* Use our own variant of 'assert' and 'assert_perror'.Justus Winter2017-08-051-1/+1
| | | | | Our variants print stack traces on failures. This will make locating errors much easier.
* Fix use-after-free in libps.Esa Peuha2016-02-281-1/+1
| | | | | * libps/fmt.c (_fmt_create): Free new_fmt->src before new_fmt if reallocating fields fails.
* Fix ps -o %r infinite loopEsa Peuha2015-06-051-0/+15
| | | | | * libps/fmt.c (_fmt_create): When nothing at all was recognized, break out instead of looping.
* fix common misspellingsJonathan Neuschäfer2011-08-201-6/+6
| | | | | | * Fix spelling with codespell[1] and manually review it. [1] http://git.profusion.mobi/cgit.cgi/lucas/codespell/
* Fix ps -o command and such hangSamuel Thibault2009-11-171-1/+3
| | | | | * libps/fmt.c (_fmt_create): Put NUL terminator only when there is room for it. When there is not it is there already anyway.
* Add braces to silence gcc warnings.Roland McGrath1998-10-201-9/+11
|
* (ps_fmt_squash):Miles Bader1997-02-281-2/+3
| | | | Deal with FIELD->spec being NULL when advancing over a field.
* (_fmt_create):Miles Bader1996-10-081-7/+14
| | | | | | | | Initialize INAPP & ERROR fields. (ps_fmt_clone): Propagate them. (ps_fmt_write_proc_stat): Use them.
* (_fmt_create): Set NEW_FMT->src_len. Use strdup.Miles Bader1996-06-271-5/+36
| | | | (ps_fmt_clone): New function.
* (_fmt_create): Make NAME termination work for posix-mode.Miles Bader1996-05-281-16/+23
|
* (ps_fmt_write_proc_stat): Call the output function correctly.Miles Bader1996-05-281-8/+4
| | | | (_fmt_create): Get FIELD's precision, not width, from its spec.
* (_fmt_create):Miles Bader1996-05-231-17/+21
| | | | | Increment SRC when reading modifiers. Recognize '^' modifier.
* (_fmt_create):Miles Bader1996-05-071-122/+202
| | | | | | | | | | | Change syntax of fields. Add support for precision and `@', `:', `?', & `!' modifiers. Add POSIX argument, and support for posix-style format strings. When using the field name as the title, use the defn, not the user's. (ps_fmt_write_titles): Implement PS_FMT_FIELD_UPCASE_TITLE. (ps_fmt_squash): Call FN with the field, not the field's spec. (ps_fmt_squash_flags): Appropiately modify the function we use. (ps_fmt_create, ps_fmt_creation_error): Add POSIX argument.
* (_fmt_create): New function (was ps_fmt_create).Miles Bader1996-05-011-8/+34
| | | | | (ps_fmt_create): Call _fmt_create. (ps_fmt_creation_error): New function.
* Get rid of mega typedefs, and just use structure pointers like other hurdMiles Bader1996-03-261-60/+60
| | | | libraries. Other misc cleanups.
* (ps_fmt_create):Miles Bader1996-01-191-8/+35
| | | | | | | | Use the new spec fields. Now takes a ps_fmt_specs_t instead of an array of specs. Also fixup call to ps_fmt_specs_find(). (ps_fmt_write_proc_stat): Support new inval field in FMT. (ps_fmt_set_output_width): New function.
* (ps_fmt_write_titles, ps_fmt_write_proc_stat): Use new write function names.Miles Bader1995-11-201-8/+7
| | | | Use new STREAM parameter instead of old one and count.
* (ps_fmt_create): Don't mutate the format spec name in the fmt_spec list we'reMiles Bader1995-05-311-34/+22
| | | | | | passed just to get correctly capitalized titles. Instead, do things correctly by making enough room to store our own version of the title string, which we can do with what we please.
* Rename ps_fmt_squash to ps_fmt_squash_flags, moving most of the guts into aMiles Bader1995-05-031-62/+78
| | | | | | new more general ps_fmt_squash, which is usable for other things than flags. Recalculate the set of ps flags needed by the fmt in ps_fmt_squash (which then allows us to remove more specific code in ps_fmt_squash_flags).
* Tighten up types used (i.e., don't use int for everything).Miles Bader1995-04-071-3/+4
|
* Copy the correct number of fields when squashing.Miles Bader1995-03-141-1/+4
| | | | Correctly skip prefix-only fields.
* Initial revisionMiles Bader1995-03-131-0/+385