Revision: 5548 http://geany.svn.sourceforge.net/geany/?rev=5548&view=rev Author: statc Date: 2011-02-27 08:45:50 +0000 (Sun, 27 Feb 2011)
Log Message: ----------- SM: Don't set the userid property if the user name can't be determined. Borrowed from alternative SM patch by Dimitar Zhekov, thanks.
Modified Paths: -------------- branches/sm/src/sm.c
Modified: branches/sm/src/sm.c =================================================================== --- branches/sm/src/sm.c 2011-02-27 08:45:29 UTC (rev 5547) +++ branches/sm/src/sm.c 2011-02-27 08:45:50 UTC (rev 5548) @@ -356,24 +356,26 @@ const gchar * username = g_get_user_name(); gchar * curdir = g_get_current_dir();
- SmPropValue userid_val = { - username ? strlen(username) : 0, - username ? (char *)username : ""}; - SmPropValue curdir_val = { - strlen(curdir), - curdir}; + SmProp program_prop = {SmProgram, SmARRAY8, 1, &sm_program_val};
- SmProp program_prop = {SmProgram, SmARRAY8, 1, &sm_program_val}; - SmProp userid_prop = {SmUserID, SmARRAY8, 1, &userid_val}; + SmPropValue curdir_val = {strlen(curdir), curdir}; SmProp curdir_prop = {SmCurrentDirectory, SmARRAY8, 1, &curdir_val};
- SmProp * proplist[3] = { + SmProp * proplist[2] = { &program_prop, - &userid_prop, &curdir_prop }; - SmcSetProperties(smcon, 3, proplist); + SmcSetProperties(smcon, 2, proplist);
+ if (username) + { + SmPropValue userid_val = {strlen(username), (char *)username}; + SmProp userid_prop = {SmUserID, SmARRAY8, 1, &userid_val}; + + proplist[0] = &userid_prop; + SmcSetProperties(smcon, 1, proplist); + } + g_free(curdir); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.