aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Document the new -r flagThomas Voss 2022-10-081-6/+26
|
* Mark TODO #2 as completeThomas Voss 2022-10-081-1/+1
|
* Add the -r flag to print tabs using spacessheepmax 2022-10-081-28/+63
| | | | | | | | If the -r flag is provided, then tabs will be displayed by printing a space character `tabwidth' times. With this commit TODO item #2 is complete. Co-authored-by: Thomas Voss <mail@thomasvoss.com>
* De-verbosify usageThomas Voss 2022-10-082-5/+5
|
* Document the new -l and -t flagsThomas Voss 2022-10-081-6/+19
|
* Wrap code to 80 columnsThomas Voss 2022-10-051-11/+21
| | | | | | With my new laptop setup and stuff, 80 characters is about half of the screen; wrapping code to 80 columns allows me to have two terminals in a split screen while viewing all the code.
* Sort command-line flagsThomas Voss 2022-10-051-12/+12
|
* Mark TODO #1 as completeThomas Voss 2022-10-051-1/+1
| | | | nothing-c completed that TODO in commit a05ee66.
* Add tab width specification (#5)nothing-c 2022-10-051-3/+13
| | | | | Add default value for tabsize, fix usage of width where it should have tabsize, fix optarg string, limit tabsize to being non-negative only.
* Remove excess parensThomas Voss 2022-10-041-1/+1
|
* Fix bug when width is less than line lengthThomas Voss 2022-10-041-3/+3
| | | | | | If the length of a line is longer than the width of the display we want to center on, `width - len` becomes negative which causes an infinite loop of printing spaces. This fixes that bug.
* Update Caspers' default email addressThomas Voss 2022-10-041-2/+2
| | | | | cas — Today at 07:18 Use <casper.casan@gmail.com>
* Mark TODO #3 as completeThomas Voss 2022-10-041-1/+1
| | | | Casper completed that TODO in commit 7aed855.
* Add a .mailmapThomas Voss 2022-10-041-0/+3
| | | | | | | My older commits on this repo were under the email <thomasvoss@live.com> instead of my newer <mail@thomasvoss.com>. Casper also has commits as both <casper@casan.se> and <casper.casan@gmail.com> with the names Casper and Casper Andersson, so this should fix those issues.
* Add centering by longest line (#3)Casper Andersson 2022-10-041-3/+73
| | | | | | | | | | Centering by longest line requires inputting all lines before starting output, to determine which is longest. Use a tail queue for this to insert at end and then iterate from start. The lines are freed after being output. Unlike the static read buffer, we can't reuse the list buffers in an easy way if we are iterating over multiple input files. So they need to be freed to avoid memory leaks.
* Add TODO #4Thomas Voss 2022-10-031-0/+5
|
* Remove unused flags from call to getopt()Thomas Voss 2022-10-031-1/+1
|
* Make buffer and size static to avoid memory leakCasper Andersson 2022-10-011-2/+2
| | | | | | | getline() allocates/reallocates memory dynamically. When center() is called repeatedly it would leak memory. Make them static so the same memory is reallocated all the time, and none is lost. No need to free manually, let the OS take care of that.
* Properly terminate the listThomas Voss 2022-10-011-0/+1
|
* Update my email-addressThomas Voss 2022-10-011-1/+1
|
* Fix centering with ANSI escapesThomas Voss 2022-09-231-1/+1
| | | | | | This was broken with the logic change in #68f7fb9 I think. At the very least it’s that commit after which I noticed this bug. Doesn’t matter though, it’s fixed now.
* Enable warningsThomas Voss 2022-09-231-1/+1
|
* Add a target variableThomas Voss 2022-09-231-5/+7
|
* Fix text centering of multibyte charactersThomas Voss 2022-09-231-2/+7
|
* Add license textThomas Voss 2022-09-202-0/+31
|
* Use unicode box charactersThomas Voss 2022-09-201-33/+33
|
* Add a READMEThomas Voss 2022-09-201-0/+13
|
* Add a TODO fileThomas Voss 2022-09-201-0/+70
| | | | | | With Hacktoberfest coming up, a TODO will allow potential new people to find issues to work on. GitHub issues could be used, but the main repo is not on GitHub so no thanks.
* Fix usage stringThomas Voss 2022-08-091-1/+1
|
* Fix usage example in manual pageThomas Voss 2022-02-101-2/+2
| | | | | | The example is supposed to center the input as if the output device is a terminal with a width of 80 characters. The example doesn't use the `-w' flag though, so we set that up.
* Don't exit when fopen(3) returns NULLThomas Voss 2022-02-081-4/+7
| | | | | | | | On failure to open a file the program should print a diagnostic message to the standard error and move on to the next file as opposed to exiting immediately. This allows for consistent behavior compared to other common implementations of utilities such as cat(1) which reduces potential confusion for the user.
* Initial commitThomas Voss 2022-02-085-0/+275
This initial commit includes the following: - A gitignore file - A license (0-Clause BSD) - A Makefile supporting installation - A manual page written in mdoc(7) - A fully working initial implementation