[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nsis-commits
Subject:    [NSIS-commits] SF.net SVN: nsis:[6107] NSIS/trunk/Source
From:       wizou () users ! sourceforge ! net
Date:       2010-06-16 16:01:41
Message-ID: E1OOv3d-0007R3-5p () sfp-svn-1 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 6107
          http://nsis.svn.sourceforge.net/nsis/?rev=6107&view=rev
Author:   wizou
Date:     2010-06-16 16:01:40 +0000 (Wed, 16 Jun 2010)

Log Message:
-----------
#1787648: ${__SECTION__} is correctly defined in hidden section

Modified Paths:
--------------
    NSIS/trunk/Source/build.cpp
    NSIS/trunk/Source/script.cpp

Modified: NSIS/trunk/Source/build.cpp
===================================================================
--- NSIS/trunk/Source/build.cpp	2010-06-16 15:07:05 UTC (rev 6106)
+++ NSIS/trunk/Source/build.cpp	2010-06-16 16:01:40 UTC (rev 6107)
@@ -1187,10 +1187,9 @@
 
   TCHAR *name = (TCHAR*)secname;
 
-  // Is it a hidden section?
-  if (secname[0] == _T('-'))
+  if (name[0] == _T('\x1F'))    // SectionGroup/SectionGroupEnd
   {
-    if (secname[1])
+    if (name[1])
     {
       new_section.flags |= SF_SECGRP;
       name++;
@@ -1199,6 +1198,10 @@
       new_section.flags |= SF_SECGRPEND;
   }
 
+  int hidden = (name[0] == _T('-'));
+  if (hidden)
+    name++;
+  
   if (name[0] == _T('!'))
   {
     name++;
@@ -1236,8 +1239,8 @@
 
   new_section.code = cur_entries->getlen() / sizeof(entry);
 
-  new_section.install_types = *name ? 0 : ~0;
-  new_section.name_ptr = add_string(name);
+  new_section.install_types = (!hidden && *name) ? 0 : ~0;
+  new_section.name_ptr = hidden ? 0 : add_string(name);
   memset(&new_section.name,0,sizeof(new_section.name));
 
   cur_sections->add(&new_section, sizeof(section));

Modified: NSIS/trunk/Source/script.cpp
===================================================================
--- NSIS/trunk/Source/script.cpp	2010-06-16 15:07:05 UTC (rev 6106)
+++ NSIS/trunk/Source/script.cpp	2010-06-16 16:01:40 UTC (rev 6107)
@@ -3457,14 +3457,7 @@
 
       int ret;
 
-      if (line.gettoken_str(a)[0]==_T('-'))
-      {
-        if (!_tcsnicmp(line.gettoken_str(a)+1,_T("un."),3))
-          ret=add_section(_T("un."),line.gettoken_str(a+1));
-        else
-          ret=add_section(_T(""),line.gettoken_str(a+1));
-      }
-      else ret=add_section(line.gettoken_str(a),line.gettoken_str(a+1));
+      ret=add_section(line.gettoken_str(a),line.gettoken_str(a+1));
       if (ret != PS_OK) return ret;
 
       if (unselected)
@@ -3522,7 +3515,7 @@
         ex = 1;
         a++;
       }
-      wsprintf(buf,_T("-%s"),line.gettoken_str(a));
+      wsprintf(buf,_T("\x1F%s"),line.gettoken_str(a));
       if (which_token == TOK_SECTIONGROUP || which_token == TOK_SUBSECTION)
       {
         TCHAR *s = line.gettoken_str(a);


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
NSIS-commits mailing list
NSIS-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nsis-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic