Commit Graph

116 Commits

Author SHA1 Message Date
Giles Atkinson 4feb0c3ccc Remove function cp_ccon() and related code. The function modifies
the terminal driver's treatment of the control-D (EOF) and escape
keys on Unix-like OSs.  But escape has no special meaning, and treating
control-D as a line terminator was probably to prevent unexpected
session exit when connected through a modem without error-correction.

Removing the function allows "ngspice netlist &" to work correctly.
The function was called during initialisation, which caused an endless
loop of job-control stops when ngspice was started as a background process.
2024-12-06 22:40:38 +01:00
Holger Vogt 88844ba74d Prevent vectors carrying the E POLY source current from being disaggregated 2023-12-31 13:32:45 +01:00
Giles Atkinson 89851872ed When substituting interpreter variables, allow '$' to be part of
the variable expresstion only within '[]' or '()'. That lets
forms like "$a$b" to be treated as two substitutions, not one.
2023-11-27 15:13:31 +00:00
Holger Vogt c87df54f24 Remove unused global variable cp_dol.
This also prevents a gcc 13 bug, as cp_dol has been set to '\0'
by -O2 optimization (see
https://stackoverflow.com/questions/77407156/s-0-being-optimized-out-possible-gcc-13-bug-or-some-undefined-behaviour)
2023-11-11 10:39:51 +01:00
Giles Atkinson 2790fd68bb Make the special "noglob" variable work. To preserve previous behaviour
change the default value from true to undefined (meaning false).
Also fix a misleading comment in glob.c.
2023-09-25 10:54:13 +02:00
Holger Vogt aa10f9344e Add variable "csnumprec" to allow setting the precision of vectors
and variables as arguments to functions listet in manual chapter 17.5.
Default is 6, as has been standard up to now.
2023-07-31 14:27:23 +02:00
Holger Vogt 037293c81e Improved error message: more info on the bad set form 2022-10-07 13:22:43 +02:00
Giles Atkinson 40c2419a43 Two memory leaks found interactively with valgrind with safe fixes. 2022-05-10 15:30:08 +02:00
Holger Vogt 7f085144a9 remove all the remains of quote() and strip() that had been
used to modify the eigths bit of a character or string.
The functions had been switched off some time ago.
We now need all bits of a char for extended ascii or utf8
2020-03-15 08:51:12 +01:00
Holger Vogt 8639144093 cp_getvar: force a limit to a string entered
Issue a warning, truncate the string
2020-03-15 08:51:11 +01:00
Jim Monte 8141a634d7 Fixed several issues related to plotting and vector lifetimes and made ownership of vectors clearer. The issues in bugs 419, 423, 425, and 426 were related and were addressed here. 2020-03-15 08:50:54 +01:00
Jim Monte 92725594f3 Used the new capabilities of ft_numparse() to allow the creation of variables and list items of type CP_NUM 2020-03-15 08:50:53 +01:00
Jim Monte 068df274bf Made ft_numparse() thread-safe (no internal static variables) and prepared to support ngspice variable type CP_NUM. 2020-03-15 08:50:52 +01:00
Jim Monte 873e4a8db0 Added no_histsubst option and related fixes 2020-03-15 08:50:52 +01:00
Jim Monte 75d233c40d If the prompt variable was set to a value that is not a string, memory that has been freed would be used when displaying the command prompt. This could lead to strange prompts and possible access violations, although it may appear to work OK if the freed memory has not been modified. This issue is fixed. Some useless duplications of strings when defining variables are also removed. 2020-03-15 08:50:51 +01:00
Jim Monte ea81da2b01 [PATCH #55-1] Fixed some compiler warnings added by Visual Studio 2019 2019-08-13 23:29:13 +02:00
Holger Vogt bfe9e29580 If a in command set name="value" value is encapsulated in double quotes, it is always treated as a string variable. 2019-08-13 23:16:37 +02:00
Holger Vogt d636f7899b cp_enqvar() returns freshly malloced variables as well
as variables owned by somebody else, e.g. from ft_curckt->ci_vars.
The new function parameter tbfreed notifies the caller if the
variable is malloced here and may be freed safely.
2018-10-13 18:19:31 +02:00
dwarning aa95da431a adaptive format specifier for size_t printf 2018-08-22 14:19:12 +02:00
Holger Vogt dc34632421 fix memory leaks when evaluating a variable
MC example file MC_ring_ts.sp is now free of memory leaks
2018-08-07 22:46:26 +02:00
Holger Vogt 09c876550f prevent string overflow by adding the string length
to the cp_getvar parameters. Used only with CP_STRING
2018-07-22 14:57:49 +02:00
Holger Vogt a98d01e5f8 Use only internal memory functions, replace
free->tfree, malloc->tmalloc, realloc->trealloc
2018-07-21 23:54:43 +02:00
rlar 939555115d variables, cp_vprint, fix a memory leak 2016-10-15 15:57:59 +02:00
rlar bc325b17c5 variables, lift plot_cur->pl_env up to the invoker of cp_usrvars() 2016-10-15 15:57:54 +02:00
rlar e0db4aa665 variables, cp_vprint(), reorder for similarity 2016-10-15 15:57:52 +02:00
rlar a33876ff59 variables, variables, cp_getvar, rewrite 2016-10-15 15:57:50 +02:00
rlar 97c5e1567f variables, cp_getvar(), beware of retval == NULL 2016-10-15 15:57:48 +02:00
rlar 20b666e2d5 variables, clean up 2016-10-15 15:57:45 +02:00
rlar b2fb4e20bf variables, drop 'found', use identity found == (*p != NULL) 2016-10-15 15:57:43 +02:00
rlar 0784f76e51 variables, cleanup the for loops 2016-10-15 15:57:40 +02:00
rlar e39119c1c8 variables, use identity v == *p (and u == *p) 2016-10-15 15:57:38 +02:00
rlar d14ee053d7 variables, use a pointer to the anchor of the variable instead of 'lv' 2016-10-15 15:57:35 +02:00
rlar b13125ac84 variables, explicit processing of ft_curckt->ci_vars, drop uv2 2016-10-15 15:57:33 +02:00
rlar 7483ff9d8c variables, cp_remvar(), cleanup 2016-10-15 15:57:30 +02:00
rlar 485fba7548 variables, add some comments, add explicit case US_NOSIMVAR 2016-10-15 15:57:28 +02:00
rlar 97cdaae19f variables, cp_usrvars(), be more explicit
lift uv2 return value up to the invoker of cp_usrvars()
2016-10-15 15:57:26 +02:00
rlar 596599492e variables, drop redundant tfree(v->va_name), rely on free_struct_variable() 2016-10-15 15:57:23 +02:00
h_vogt fe24b3e6dd variable.c, remove memory leaks 2016-10-15 15:57:19 +02:00
rlar d32968bdaa variable.h, reduce visibility of auxiliary struct xxx to variable.c 2016-10-15 15:06:16 +02:00
rlar 141ed61ec8 use memcpy() instead of deprecated bcopy() 2016-07-30 20:58:19 +02:00
h_vogt 8480898399 frontend/variable.c, remove memory leak 2016-04-01 17:40:17 +02:00
rlar ac726f0cf4 struct variable, #18/18, clean 2016-04-01 17:39:53 +02:00
rlar a6cd5eea45 struct variable, #17/18, clean 2016-04-01 17:39:22 +02:00
rlar 212121d373 struct variable, #15/18, rewrite in terms of `var_alloc_xxx()' (do-3) 2016-04-01 17:36:57 +02:00
rlar 57f56f53a6 struct variable, #14/18, introduce `var_alloc_xxx()' 2016-04-01 17:34:55 +02:00
rlar bf5acda362 struct variable, #13/18, reorder var_alloc() invocation 2016-04-01 17:34:25 +02:00
rlar eb53b4d703 struct variable, #12/18, rewrite in terms of `var_alloc()' (do-2) 2016-04-01 17:34:03 +02:00
rlar 8691368a81 struct variable, #11/18, introduce `var_alloc()' 2016-04-01 17:32:36 +02:00
rlar 68042b3d1b struct variable, #10/18, rewrite in terms of `var_set_xxx()' (do-1) 2016-04-01 17:32:12 +02:00
rlar bbbd531d8d struct variable, #9/18, introduce `var_set_xxx()' 2016-04-01 17:29:58 +02:00