"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/mx/shexp.c" between
s-nail-14.9.18.tar.xz and s-nail-14.9.19.tar.xz

About: S-nail is a mail processing system intended to provide the functionality of the POSIX mailx command and offers extensions for line editing, IDNA, MIME, S/MIME, SMTP and POP3 (and IMAP). It is usable as a mail batch language.

shexp.c  (s-nail-14.9.18.tar.xz):shexp.c  (s-nail-14.9.19.tar.xz)
skipping to change at line 81 skipping to change at line 81
* Other characters may be permitted by an implementation; * Other characters may be permitted by an implementation;
* applications shall tolerate the presence of such names. * applications shall tolerate the presence of such names.
* We do support the hyphen-minus "-" (except in last position for ${x[:]-y}). * We do support the hyphen-minus "-" (except in last position for ${x[:]-y}).
* We support some special parameter names for one-letter(++) variable names; * We support some special parameter names for one-letter(++) variable names;
* these have counterparts in the code that manages internal variables, * these have counterparts in the code that manages internal variables,
* and some more special treatment below! */ * and some more special treatment below! */
#define a_SHEXP_ISVARC(C) (su_cs_is_alnum(C) || (C) == '_' || (C) == '-') #define a_SHEXP_ISVARC(C) (su_cs_is_alnum(C) || (C) == '_' || (C) == '-')
#define a_SHEXP_ISVARC_BAD1ST(C) (su_cs_is_digit(C)) /* (Assumed below!) */ #define a_SHEXP_ISVARC_BAD1ST(C) (su_cs_is_digit(C)) /* (Assumed below!) */
#define a_SHEXP_ISVARC_BADNST(C) ((C) == '-') #define a_SHEXP_ISVARC_BADNST(C) ((C) == '-')
#define a_SHEXP_ISENVVARC(C) (su_cs_is_alnum(C) || (C) == '_')
#define a_SHEXP_ISENVVARC_BAD1ST(C) su_cs_is_digit(C)
#define a_SHEXP_ISENVVARC_BADNST(C) (FAL0)
enum a_shexp_quote_flags{ enum a_shexp_quote_flags{
a_SHEXP_QUOTE_NONE, a_SHEXP_QUOTE_NONE,
a_SHEXP_QUOTE_ROUNDTRIP = 1u<<0, /* Result won't be consumed immediately */ a_SHEXP_QUOTE_ROUNDTRIP = 1u<<0, /* Result won't be consumed immediately */
a_SHEXP_QUOTE_T_REVSOL = 1u<<8, /* Type: by reverse solidus */ a_SHEXP_QUOTE_T_REVSOL = 1u<<8, /* Type: by reverse solidus */
a_SHEXP_QUOTE_T_SINGLE = 1u<<9, /* Type: single-quotes */ a_SHEXP_QUOTE_T_SINGLE = 1u<<9, /* Type: single-quotes */
a_SHEXP_QUOTE_T_DOUBLE = 1u<<10, /* Type: double-quotes */ a_SHEXP_QUOTE_T_DOUBLE = 1u<<10, /* Type: double-quotes */
a_SHEXP_QUOTE_T_DOLLAR = 1u<<11, /* Type: dollar-single-quotes */ a_SHEXP_QUOTE_T_DOLLAR = 1u<<11, /* Type: dollar-single-quotes */
a_SHEXP_QUOTE_T_MASK = a_SHEXP_QUOTE_T_REVSOL | a_SHEXP_QUOTE_T_SINGLE | a_SHEXP_QUOTE_T_MASK = a_SHEXP_QUOTE_T_REVSOL | a_SHEXP_QUOTE_T_SINGLE |
a_SHEXP_QUOTE_T_DOUBLE | a_SHEXP_QUOTE_T_DOLLAR, a_SHEXP_QUOTE_T_DOUBLE | a_SHEXP_QUOTE_T_DOLLAR,
skipping to change at line 2042 skipping to change at line 2046
input.s = UNCONST(char*,cp); input.s = UNCONST(char*,cp);
input.l = UZ_MAX; input.l = UZ_MAX;
rv = n_string_cp(n_shexp_quote(n_string_creat_auto(&store), &input, rv = n_string_cp(n_shexp_quote(n_string_creat_auto(&store), &input,
rndtrip)); rndtrip));
n_string_gut(n_string_drop_ownership(&store)); n_string_gut(n_string_drop_ownership(&store));
NYD2_OU; NYD2_OU;
return rv; return rv;
} }
FL boole FL boole
n_shexp_is_valid_varname(char const *name){ n_shexp_is_valid_varname(char const *name, boole forenviron){
char lc, c; char lc, c;
boole rv; boole rv;
NYD2_IN; NYD2_IN;
rv = FAL0; rv = FAL0;
lc = '\0';
for(lc = '\0'; (c = *name++) != '\0'; lc = c) if(!forenviron){
if(!a_SHEXP_ISVARC(c)) for(; (c = *name++) != '\0'; lc = c)
if(!a_SHEXP_ISVARC(c))
goto jleave;
else if(lc == '\0' && a_SHEXP_ISVARC_BAD1ST(c))
goto jleave;
if(a_SHEXP_ISVARC_BADNST(lc))
goto jleave; goto jleave;
else if(lc == '\0' && a_SHEXP_ISVARC_BAD1ST(c)) }else{
for(; (c = *name++) != '\0'; lc = c)
if(!a_SHEXP_ISENVVARC(c))
goto jleave;
else if(lc == '\0' && a_SHEXP_ISENVVARC_BAD1ST(c))
goto jleave;
if(a_SHEXP_ISENVVARC_BADNST(lc))
goto jleave; goto jleave;
if(a_SHEXP_ISVARC_BADNST(lc)) }
goto jleave;
rv = TRU1; rv = TRU1;
jleave: jleave:
NYD2_OU; NYD2_OU;
return rv; return rv;
} }
FL int FL int
c_shcodec(void *vp){ c_shcodec(void *vp){
struct str in; struct str in;
 End of changes. 6 change blocks. 
6 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)