about summary refs log tree commit diff stats
path: root/src/tools/parser.c
Commit message (Collapse)AuthorAgeFilesLines
* Adapt to g_string_free glib 2.75.3 changeMichael Vetter2023-03-211-5/+1
| | | | | | | | | | | | glib 2.75.3 changes warning behaviour of `g_string_free()`. See: * https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3219 * https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3226 Use this opportunity to replace the use of GString with `g_strdup_printf()` where possible. Otherwise correctly take the return value of `g_string_free()` which is nicer anyways.
* Improve cmd argument parserMarcoPolo-PasTonMolo2022-06-161-3/+12
| | | | | | | | | "" used to become " now it just becomes an empty argument. Also if quotes appeared after a token started then if the number of quotes in the token is n the resulting one would be a token with the n last characters cut off, now it's fixed. Fixes https://github.com/profanity-im/profanity/issues/497
* Add config.h in files were it was missingMichael Vetter2021-03-261-0/+2
| | | | Related to https://github.com/profanity-im/profanity/issues/1512
* Declare counter var inside loopMichael Vetter2020-11-091-11/+6
| | | | We require c99/gnu99 anyways.
* parser.c: Use glibMichael Vetter2020-07-231-4/+4
| | | | | | | | We use malloc() to allcoate memory for the arguments. But later on in cmd_funcs.c we use g_strfreev() to free it. Let's use g_malloc() to allocate instead. Second change is to use g_malloc() and g_free() for a gchar.
* Fix /correct quotation marks usageMichael Vetter2020-07-231-0/+27
| | | | | | | Add new `parse_args_as_one()` function to just use everything after the command as the argument. Fix https://github.com/profanity-im/profanity/issues/1404
* parser.c: Use helper function to reduce duplicate codeMichael Vetter2020-07-211-143/+50
| | | | | | | | | | `parse_args()` and `parse_args_with_freetext()` shared a lot of common code. Let's have a helper function `_parse_args_helper()` for that. The `with_freetext` parameter will make it behave like `parse_args_with_freetext()`. In preparation for https://github.com/profanity-im/profanity/issues/1404
* parse_args(): Call g_free() onceMichael Vetter2020-07-211-3/+2
|
* Use parse_args_with_freetext() for `/correct`Michael Vetter2020-07-201-2/+2
| | | | | | | | | | | | | This commit partly reverts 8f37afcd37ad8663ca36c13ca7fbc4a431119f73 Which was using a wrong approach to achieve this. It changed parse_args() to have a -1 for infinite parameters. But actually parse_args_with_freetext() should have been used exactly for this behaviour. Discovered when checking for https://github.com/profanity-im/profanity/issues/1404
* Fix typo in commentMichael Vetter2020-07-151-1/+1
|
* Apply coding styleMichael Vetter2020-07-071-44/+44
|
* Revert "Apply coding style"Michael Vetter2020-07-071-44/+44
| | | | | | This reverts commit 9b55f2dec0ea27a9ce4856e303425e12f866cea2. Sorting the includes creates some problems.
* Apply coding styleMichael Vetter2020-07-071-44/+44
| | | | Regards https://github.com/profanity-im/profanity/issues/1396
* xep-0308: Make /correct work without quotation marksMichael Vetter2020-02-141-2/+2
| | | | | | Now we can specify an unlimited amount of arguments for commands. Maybe this is also helpful for other commands that use quotation marks so far.
* Add vim modelineMichael Vetter2019-11-131-0/+1
|
* Free list in error case in parse_optionsMichael Vetter2019-10-061-0/+3
| | | | | | Fix memleaks. Regards https://github.com/profanity-im/profanity/issues/1019
* Fix memleak in get_start()Michael Vetter2019-10-061-0/+1
| | | | Regards https://github.com/profanity-im/profanity/issues/1019
* Update copyright to include 2019Michael Vetter2019-01-221-1/+1
|
* Update copyrightJames Booth2018-01-211-1/+1
|
* Update CopyrightJames Booth2017-01-281-1/+1
|
* Update GPL link in headersJames Booth2016-07-241-1/+1
|
* Updated copyrightJames Booth2016-02-141-1/+1
|
* Applied coding style to src/tools/James Booth2015-10-251-8/+8
|
* Use null check convention in parser.cJames Booth2015-05-041-4/+4
|
* Fixed spelling.Christian Storm2015-02-171-5/+5
|
* Updated copyrightJames Booth2015-02-101-1/+1
|
* Simplified autocompleters and command historyJames Booth2015-01-161-2/+2
|
* Added license exemption for OpenSSL to source headersJames Booth2014-08-241-0/+12
|
* Free tokens when 0 supplied an 0 min, parse_args_with_freetextJames Booth2014-06-171-0/+1
|
* Added common.h to parser.cJames Booth2014-05-221-0/+2
|
* Fixed cppcheck warningsJames Booth2014-04-261-2/+1
|
* Simplified parse_options to take first option as argumentJames Booth2014-04-151-4/+4
|
* Simplified parse_options to take gchar**James Booth2014-04-151-1/+12
|
* Refactored cmd_join to use parse_optionsJames Booth2014-04-141-2/+2
|
* Check for duplicate options in option parserJames Booth2014-04-141-2/+19
|
* Added parse_optionsJames Booth2014-04-141-0/+40
|
* Command argument parsers set result argumentJames Booth2014-04-091-4/+10
|
* Updated copyrightJames Booth2014-03-091-1/+1
|
* Moved free in parse_args_with_freetextJames Booth2013-09-231-2/+2
| | | | issue #226
* Fixed memory leak in parse_args_with_freetextJames Booth2013-09-231-2/+2
| | | | issue #226
* Fix quoted nicknames in /group addJames Booth2013-08-271-1/+1
| | | | fixes #233
* Fix freetext arguments with quotesJames Booth2013-07-201-5/+5
| | | | fixes #203
* Remaining parser function unicode compatibleJames Booth2013-07-141-30/+29
|
* Added parser testsJames Booth2013-07-141-2/+0
|
* Implemented parse_args_with_freetext with unicode compatibilityJames Booth2013-07-141-20/+26
|
* Implemented parse_args with unicode compatibilityJames Booth2013-07-141-4/+17
|
* Handle unicode chars in command parserJames Booth2013-07-121-9/+14
|
* Removed if clause in parserJames Booth2013-07-111-2/+0
|
* Moved functions to parser.c, moved parser to toolsJames Booth2013-07-111-0/+349