[Home]

Summary:ASTERISK-11228: [patch] small warning added when using Set() or MSet() and variable names with spaces
Reporter:Caio Begotti (caio1982)Labels:
Date Opened:2008-01-13 11:36:00.000-0600Date Closed:2008-01-14 09:05:47.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) setvar_space_warning.diff
( 1) setvar_space_warning1.diff
Description:Spaces before or after variable names (until '=' is reached) may lead to unexpected results as it's quite difficult to detect this just looking at the dialplan. Like, Set( x=5) will create ' x' not 'x', the same for Set(y =5).

Master Murf talked about it long time ago in ASTERISK-8030 and I thought it was added sometime after maybe, but today I started having problem with it again and didn't notice the damn spaces, so I think it won't hurt adding.
Comments:By: Tilghman Lesher (tilghman) 2008-01-14 00:48:43.000-0600

Any reason you're using strrchr instead of strchr?

By: Caio Begotti (caio1982) 2008-01-14 05:04:45.000-0600

Actually... none, in my mind I used strchr. Re-uploaded.

By: Digium Subversion (svnbot) 2008-01-14 09:05:46.000-0600

Repository: asterisk
Revision: 98714

U   trunk/main/pbx.c

------------------------------------------------------------------------
r98714 | file | 2008-01-14 09:05:45 -0600 (Mon, 14 Jan 2008) | 6 lines

Print out a warning when spaces are used in the variable name in Set and MSet. It is extremely hard to debug this issue so this should make it easier.
(closes issue ASTERISK-11228)
Reported by: caio1982
Patches:
     setvar_space_warning1.diff uploaded by caio1982 (license 22)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=98714