From 06ee5510a75d1587851dc0a0e5e3b20f4746952e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 30 Mar 2016 17:48:18 +0200 Subject: [PATCH] Version 15.168.3 --- swad_changelog.h | 3 ++- swad_parameter.c | 38 +++++++++++++++++--------------------- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 1f115361..05bd52f9 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -138,13 +138,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.168.2 (2016-03-30)" +#define Log_PLATFORM_VERSION "SWAD 15.168.3 (2016-03-30)" #define CSS_FILE "swad15.165.5.css" #define JS_FILE "swad15.131.3.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 15.168.3: Mar 30, 2016 Code refactoring in list of parameters. (197124 lines) Version 15.168.2: Mar 30, 2016 Code refactoring in list of parameters. (197128 lines) Version 15.168.1: Mar 30, 2016 Fixed bug in list of parameters. (197097 lines) Version 15.168: Mar 30, 2016 When content is normal, all parameters are retrieved in a list. (197085 lines) diff --git a/swad_parameter.c b/swad_parameter.c index 6fcaecd8..e3abce58 100644 --- a/swad_parameter.c +++ b/swad_parameter.c @@ -157,6 +157,19 @@ bool Par_GetQueryString (void) /*****************************************************************************/ /************************ Create list of parameters **************************/ /*****************************************************************************/ +/* Parameter #1 Parameter #2 Parameter #3 + +-------------+ +-------------+ +-------------+ +List -> | Name.Start | --> | Name.Start | --> | Name.Start | + +-------------+ / +-------------+ / +-------------+ + | Name.Length | / | Name.Length | / | Name.Length | + +-------------+ / +-------------+ / +-------------+ + | Value.Start | / | Value.Start | / | Value.Start | + +-------------+ / +-------------+ / +-------------+ + | Value.Lengh | / | Value.Lengh | / | Value.Lengh | + +-------------+ / +-------------+ / +-------------+ + | Next ----- | Next ----- | NULL | + +-------------+ +-------------+ +-------------+ +*/ static void Par_CreateListOfParams (void) { @@ -174,19 +187,7 @@ static void Par_CreateListOfParams (void) /*****************************************************************************/ /**************** Create list of parameters from query string ****************/ /*****************************************************************************/ -/* - +-------------+ +-------------+ +-------------+ -List -> | Name.Start | --> | Name.Start | --> | Name.Start | - +-------------+ / +-------------+ / +-------------+ - | Name.Length | / | Name.Length | / | Name.Length | - +-------------+ / +-------------+ / +-------------+ - | Value.Start | / | Value.Start | / | Value.Start | - +-------------+ / +-------------+ / +-------------+ - | Value.Lengh | / | Value.Lengh | / | Value.Lengh | - +-------------+ / +-------------+ / +-------------+ - | Next ----- | Next ----- | NULL | - +-------------+ +-------------+ +-------------+ -*/ + static void Par_CreateListOfParamsFromQueryString (void) { unsigned long CurPos; // Current position in query string @@ -194,16 +195,11 @@ static void Par_CreateListOfParamsFromQueryString (void) struct Param *NewParam; /***** Check if query string is empty *****/ + Gbl.Params.List = NULL; if (Gbl.Params.QueryString == NULL) - { - Gbl.Params.List = NULL; return; - } if (!Gbl.Params.QueryString[0]) - { - Gbl.Params.List = NULL; return; - } /***** Go over the query string getting start positions and lengths of parameters *****/ @@ -217,9 +213,9 @@ static void Par_CreateListOfParamsFromQueryString (void) /* Link the previous element in list with the current element */ if (CurPos == 0) - Gbl.Params.List = NewParam; + Gbl.Params.List = NewParam; // Pointer to first param else - Param->Next = NewParam; + Param->Next = NewParam; // Pointer from former param to new param /* Make the current element to be the just created */ Param = NewParam;