summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-10-29Initial CommitHEADmasterBenjamin Chausse
2020-05-14Avoid out-of-bounds access when a slide input line begins with \0Chris Down
If we read in a line with \0 at the beginning, blen will be 0. However, we then try to index our copy of the buffer with s->lines[s->linecount][blen-1], we'll read (and potentially write if the data happens to be 0x0A) outside of strdup's allocated memory, and may crash. Fix this by just rejecting lines with a leading \0. Lines with nulls embedded in other places don't invoke similar behaviour, since the length is still >0.
2017-09-07update licenseMarkus Teich
2017-09-07Correctly handle files that contain no slidesLaslo Hunhold
Otherwise, on reloading sent would segfault. Move the check-logic to load() rather than doing it in main() to prevent other misuses of it in the future.
2017-09-04update licenseMarkus Teich
2017-09-03release v1Markus Teich
2017-09-02allow to reload fileMarkus Teich
2017-09-02fix some spelling in man pageMarkus Teich
2017-09-02update manpageMarkus Teich
2017-09-02migrate to new arg.hMarkus Teich
2017-09-02load all images before starting the presoMarkus Teich
2016-11-04replace malloc() with ecalloc()Markus Teich
2016-11-04die() on calloc failureMarkus Teich
2016-10-10check memory allocation for calloc, die on failureHiltjo Posthuma
2016-10-10README: add Xft to dependenciesssd
2016-09-26always redraw imagesMarkus Teich
Previously when covering the sent window with an image slide selected and exposing it again, the image was lost. This change always redraws the image and also removes the now redundant bit flag in the state enum.
2016-08-12improve some more error messagesHiltjo Posthuma
- remove \n in die() messages in drw.c - add a few more ':' suffix for functions that set errno. - minor typo.
2016-08-12Add a manpageFRIGN
2016-08-12Use Plan 9 style for ARGENDFRIGN
2016-08-12Fix error-messagesFRIGN
2016-08-11Fix memory leak and print a warning on invalid regexFRIGN
This will minimize the already low memory usage of sent.
2016-08-11_exit() instead of exit() after failed execFRIGN
die() calls exit(), but actually at this point the program could be in a state not allowing this. It's better to call _exit to stop the libc from calling any handlers that might fail at this moment anyway.
2016-07-18Simplify LICENSE wordingFRIGN
Now, before you call your lawyers, here is some explanation: The MIT/X Consortium-License and ISC-License are equivalent according to the Berne-convention. This means that a court of law presented with either licenses will act the same. The advantage of the ISC license is that it has a simpler wording and is recommended by the OpenBSD-project for new projects[0]. And as we at suckless.org love removing cruft, this also includes removing legal cruft wording that is not needed any more. [0]: http://www.openbsd.org/policy.html
2016-07-14Simplify usage()FRIGN
2016-07-14Update example presentationMarkus Teich
- Add a small transparent farbfeld test image
2016-07-14add ff and ff.bz2 support in config.def.hFRIGN
2016-06-30Also call ffload on the current slide in advance()Markus Teich
This fixes a bug where the image would not be loaded if the user setup a keybinding which advances multiple slides at once. Then the preloading for the previous/next slide in advance() would not catch that case and instead of an image the text version (`@filename`) would be rendered on the slide.
2016-06-30clean ffread and rename to ffloadMarkus Teich
- also remove unneeded memmove in load()
2016-06-06load slide image on-demandHiltjo Posthuma
On Sat, Jun 04, 2016 at 05:28:31PM +0200, Markus Teich wrote: > Hiltjo Posthuma wrote: > > previously an image file would be opened but only ffread when advancing to > > the slide, but when the slide was not used it gave an error: > > > > /usr/local/bin/2ff: failed to convert image/png > > Heyho Hiltjo, > > thanks for the patch. Unfortunately it does not work if the first slide contains > an image (ffopen is only called in advance). I think it would be good to merge > ffopen and ffread instead into a single function ffload. This makes the `LOADED` > state clearer and also enforces that the fd is closed in the same function where > it is opened. This ffload function should then be called in advance() replacing > the ffread() calls if the image is not loaded yet and once in load() for the > first slide if it is an image. > Ah yes, sorry for the oversight. > If you want to take this new approach, go for it, otherwise I'll look into it > myself. > I have attached a patch that does this, I hope you'll like it. Also I'm not sure if we need the below code in advance(), I have removed it in the patch: if (slidecount > idx + 1 && slides[idx + 1].img) ffread(slides[idx + 1].img); if (0 < idx && slides[idx - 1].img) ffread(slides[idx - 1].img); That seems to preload the next and previous slide image right? A minor issue I notice also is that images seem to flicker, it uses XPutImage directly to xw.win. Maybe it can be replaced with a backbuffer then XCopyArea? What do you think? In advance() it should also not always be needed to rescale the image. -- Kind regards, Hiltjo From 97bebdcab4003f9acdfdd4bdf424449299ffd61d Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 4 Jun 2016 21:34:25 +0200 Subject: [PATCH] merge ffread and ffopen into one function
2016-06-04load slide image on-demandHiltjo Posthuma
previously an image file would be opened but only ffread when advancing to the slide, but when the slide was not used it gave an error: /usr/local/bin/2ff: failed to convert image/png this changes it to load the image on-demand once and "cache" it.
2016-05-24import new drw and util from libsl.Markus Teich
2016-03-15fix include and lib paths for the BSDsMarkus Teich
2016-03-15support FreeBSDMarkus Teich
On FreeBSD the lib and include directories are in /usr/local rather than /usr.
2016-03-06Import arg.h OOB fix from Lucas Gabriel Vuotto.Markus Teich
This is a small fix for arg.h where it's possible to perform an out-of-boundary memory access in argv's internal string.
2016-03-06Fix cmdline argument checkMarkus Teich
There was a segfault when sent was called without arguments. Now we use stdin when there's no argument or - is used. Thanks to izabera for the report.
2016-02-06no need to reimplement cat hereMarkus Teich
2016-02-06improve error handlingMarkus Teich
- errors are now fatal - no need to clean up when dying - no need for status return codes => ffread and ffprepare now return void
2016-02-05style: move function return types to own lineMarkus Teich
2016-02-05Use 2ff exclusively in config.def.hFRIGN
2016-02-05Fix alpha blendingFRIGN
- "/ 257", because 255 * 257 = UINT16_MAX - "/ 255", because that's the maximum possible RGB value
2016-02-05readme: update reference to farbfeldMarkus Teich
2015-12-24Change an eprintf to a die to stop child from running its own slideshowDavid Phillips
The child thread was created because execlp will not return if successful. The eprintf was placed after the call to execlp to catch any error, but the child continued to return a (closed) fds[0], resulting in a second slideshow being run by the child. This commit fixes the issue by killing the child.
2015-12-24filter via shell pipelineGrant Mathews
Instead of requiring an executable, allow building arbitrary shell pipelines to filter filetypes through.
2015-12-09unbreak the buildMarkus Teich
2015-12-09fix 2 uninitialized variables and bin == NULL checkMarkus Teich
2015-12-08check for bin == NULLMarkus Teich
2015-12-08minor syntax, style and README fixesMarkus Teich
2015-12-08support transparent imagesMarkus Teich
2015-12-08Support farbfeld as an intermediate formatsin
Sent now uses farbfeld[0] as an intermediate format. A series of filters is specified in config.h that matches file extensions to filter programs. The programs will convert between formats such as png to farbfeld. Internally in sent we do not need to worry on how to parse png or any other format. This also works with jpg and gif and others. The 2ff wrapper will use imagemagick conversion tools. This is temporary as jpg2ff and gif2ff will also be implemented. To make this work, you will have to clone[0] and put png2ff and 2ff in your PATH. [0] http://git.2f30.org/farbfeld/
2015-12-03add 'sent: ' prefix to errorsMarkus Teich