1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-09 06:20:45 +00:00
Commit Graph

68 Commits

Author SHA1 Message Date
Ailin Nemui
883510a3fd remove deprecated defines
- PERL_STATIC_LIBS (was not tested anymore)
- HAVE_GMODULE (always required)
- HAVE_STATIC_IRC
- HAVE_STATIC_PERL
- HAVE_SOCKS (was not working properly)
- USE_GREGEX (we use it)
2022-02-20 17:33:36 +01:00
aquanight
cc759e1179 Clean up commented out stuff and fix merge issues 2020-07-10 18:27:54 -06:00
aquanight
26f3049a86 Refactor to pure refcount for PERL_SCRIPT_REC 2020-07-05 17:20:08 -06:00
aquanight
6012ec9e56 Prevent double calls of perl_script_unload 2020-07-05 15:31:07 -06:00
ailin-nemui
7e6e1f2e10 Use full paths to includes 2019-05-01 22:08:45 +02:00
Stephen Oberholtzer
5c4e6304ce Don't emit the script destroyed signal before script is actually destroyed
The script unloading code originally worked like this:

1. Destroy package
2. Emit 'script destroyed' signal
3. Unhook script's signal handlers

If a script added a 'script destroyed' signal handler, unloading
that script would cause the 'script destroyed' signal to be sent to the
(already destroyed) package.  This would cause a script error, which would
trigger a script unload, which would start the whole process over again,
until we run out of heap or stack space and segfault.

This commit simply reorders the operations so that the 'script destroyed'
signal is sent *after* the script is fully destroyed.
2017-02-28 23:48:56 -05:00
Hanno
677fb1f55c
perl_parse needs NULL terminated parameter list. 2017-01-15 22:20:23 +01:00
LemonBoy
b2424f3193 Add a '-autorun' switch to /script reset
This way we reload all the scripts in the autorun folder.
2016-09-11 16:59:21 +02:00
ailin-nemui
62cab9d662 Merge pull request #393 from ailin-nemui/moduleversion-perl
forward ABI to perl modules
2016-01-11 21:19:35 +01:00
ailin-nemui
6e01a23134 ensure staticlib perl works on 5.22 (for now) 2015-12-13 01:09:13 +01:00
ailin-nemui
9dd2b7c616 deinit perl on staticperl builds 2015-12-10 14:02:59 +01:00
ailin-nemui
ff8ccaf08b module check irssi version
Add explicit checks into every module to match the ABI version defined
in common.h
2015-12-10 00:52:33 +01:00
dequis
f14199d9c1 Change all strcmp() to g_strcmp0() to handle nulls gracefully
Just a string replacement (but i did check every one of them)

    sed -i 's/strcmp(/g_strcmp0(/g' **/*.c
2015-04-07 22:41:05 -03:00
Alexander Færøy
aaa0cb6e03 Merge pull request #52 from dgl/stack-cleanup
Correct use of perl stack macros
2014-06-29 14:27:12 +02:00
Alexander Færøy
cce0ff80a2 Merge pull request #49 from dgl/stackem
Move PUTBACK to within the scope which uses the stack
2014-06-29 14:24:20 +02:00
Alexander Færøy
113f1724d7 Merge pull request #44 from dajohi/g_basename
Replace deprecated g_basename with g_path_get_basename.
2014-06-27 14:41:54 +02:00
Alexander Færøy
b8c2915d79 Merge pull request #59 from ailin-nemui/perl-pl-na
get rid of PL_na
2014-06-27 14:31:04 +02:00
David Leadbeater
c5d81c598d Correct use of perl stack macros
Further to pull #49 this is the result of an audit of the use of perl
stack macros. There were several cases where PUTBACK was being called
where the stack pointer could be out-of-date.

Also some misc. cleanup where the macros were used needlessly.
2014-06-27 11:20:48 +01:00
David Leadbeater
211422cbe8 Switch to using G_DISCARD for call_pv
PUTBACK was being called even for the error path which didn't use the
stack. Emitting the "script error" signal can involve running Perl code
(Irssi:core::destroy) therefore the stack can be reallocated. This
can result in the perl stack being corrupted because the local stack
pointer is out of date (although as it's use of freed memory the crash
is not always instant).
2014-06-27 11:08:01 +01:00
David Leadbeater
43df6e424e Define PERL_NO_GET_CONTEXT in all perl source files
This removes the calls to Perl_get_context() that get automatically
added to XS code for ancient source code compatibility reasons.

The result is about a ~60K size reduction in the binary (based on
comparing two 64-bit stripped irssi binaries compiled
--with-perl-staticlib).
2014-06-24 20:20:27 +01:00
Lukas Mai
7dbb8efdde get rid of PL_na 2014-06-24 16:45:55 +02:00
David Hill
9d6cd87b0f Replace deprecated g_basename with g_path_get_basename. 2014-06-22 20:39:35 -04:00
Emanuele Giaquinta
fadb9f9edf Fix r4998 change, declare 'environ'.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5058 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-04-05 18:04:59 +00:00
Alexander Færøy
2fffcf5a77 Code Cleanup:
Use g_string_printf() instead of g_string_sprintf() (which is considered deprecated.)



git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5004 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-02-08 17:57:19 +00:00
Emanuele Giaquinta
b12bd857a5 Call PERL_SYS_INIT3() and PERL_SYS_TERM() as documented in perlembed(1).
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4998 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-23 17:57:49 +00:00
Emanuele Giaquinta
822e6caee8 Revert r4871, it breaks /script reset.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4992 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-17 22:28:47 +00:00
Emanuele Giaquinta
2129c4b229 Properly unload the original script when using /script load to reload it.
bug #525, patch by Lukas Mai.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4991 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-16 22:02:02 +00:00
Jilles Tjoelker
d993ce7b06 Use PERL_SYS_INIT3 with the correct pointer type for argv.
This fixes perl crashes on startup on some machines.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4989 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-15 22:21:31 +00:00
Jilles Tjoelker
84e1e871e7 Fix crash on startup if perl is compiled in.
bug #618


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4872 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-08-23 16:05:47 +00:00
Emanuele Giaquinta
47f129e0a5 Call PERL_SYS_INIT3() and PERL_SYS_TERM() as documented in perlembed(1), patch
by Gerfried Fuchs (debian bug #495059).


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4871 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-08-22 11:54:32 +00:00
Emanuele Giaquinta
97da8b64f4 Set PL_perl_destruct_level to 1 before calling perl_destruct, without
it /script reset may cause irssi to crash.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4817 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-05-13 14:27:03 +00:00
Emanuele Giaquinta
4fb888ce80 Remove support for perl 5.004 and older.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4706 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-02-05 01:01:06 +00:00
Emanuele Giaquinta
ee59980363 Remove unneeded include.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4697 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-02-02 18:05:05 +00:00
Wouter Coekaerts
9c2d621cc6 Oops. Update address correctly now.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4490 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08 18:41:10 +00:00
Wouter Coekaerts
023026e12b Update FSF address
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4489 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08 18:16:58 +00:00
Emanuele Giaquinta
b8380772e2 Remove broken code that prevents unloading of a script in some cases.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4473 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-03 08:42:33 +00:00
Wouter Coekaerts
b25c8cf1d1 Don't crash on /quit with scripts causing and catching signals during UNLOAD (thanks senneth)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4340 dbcabf3a-b0e7-0310-adc4-f8d773084564
2006-09-12 09:37:18 +00:00
Valentin Batz
19e800cf23 Fixed memory leaks when destroying a channel, when loading nonexisten scripts and in topics, patch by Toby Peterson
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3707 dbcabf3a-b0e7-0310-adc4-f8d773084564
2005-02-06 21:31:58 +00:00
Timo Sirainen
9c7360ad46 don't unload libraries when deinitializing. leaks some more memory, but fixes some crashes.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3117 dbcabf3a-b0e7-0310-adc4-f8d773084564
2003-06-27 10:53:32 +00:00
Timo Sirainen
f31b59b48b support for threaded perl. patch by mls@suse.de
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2930 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-09-19 14:30:10 +00:00
Timo Sirainen
4bb26bb951 If script returns 0 while it's being loaded, it's terminated without any
error message.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2885 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-08-25 16:04:11 +00:00
Timo Sirainen
c9f6f04079 destruct level isn't touched anymore, it crashes irssi with a few people..
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2641 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-03-24 16:35:20 +00:00
Timo Sirainen
d322b86c3d Removed some backwards compatibility code between CVS versions that broke
/SET use_perl_lib


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2367 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-02-01 23:14:00 +00:00
Timo Sirainen
f4897860b5 toupper(), tolower(), isspace(), is..etc..() aren't safe with chars in some
systems, use our own is_...() functions now instead.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2348 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-01-27 20:45:59 +00:00
Timo Sirainen
7131ceb909 g_strdup() the error message before emitting "script error" signal, since
perl scripting might be executed during that signal and it clears the error
message.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2302 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-01-10 17:36:41 +00:00
Timo Sirainen
617123b5d4 I always forget Perl 5.004 doesn't have PL_na .. so, now I've declared for
5.004, and changed all STRLEN n_a code to use PL_na instead.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2238 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-12-11 16:44:53 +00:00
Timo Sirainen
31dcd8258f Irssi::signal_add(), Irssi::timeout_add(), Irssi::input_add() and their
variants now also allow use of code references.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2199 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-12-06 17:17:40 +00:00
Timo Sirainen
cb0c661069 a bit more proper initializing of Irssi package..
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2180 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-12-03 14:40:54 +00:00
Timo Sirainen
294c94573a removed unused variable
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2178 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-12-03 13:05:46 +00:00
Timo Sirainen
ba445fe37e /SCRIPT LOAD modifies the script name so that all non-alphanumeric
characters are translated to '_' char .. now this behaviour is done also
when /SCRIPT UNLOAD is done, so people don't get confused why their "test-1"
script can't be unloaded.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2145 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-11-25 16:17:44 +00:00