~pete-woods/unity-scopes-api/add-system-session-files

« back to all changes in this revision

Viewing changes to src/scopes/internal/Utils.cpp

  • Committer: Marcus Tomlinson
  • Date: 2016-11-29 06:44:10 UTC
  • mfrom: (163.82.2 unity-scopes-api)
  • Revision ID: marcus.tomlinson@canonical.com-20161129064410-wjja6hime4t8lsm8
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
        }
267
267
        else
268
268
        {
269
 
            result += custom_exec_arg + " ";
 
269
            // The path provided is already absolute. Ensure that the SNAP env var is honored.
 
270
 
 
271
            char const* sroot = getenv("SNAP");
 
272
            std::string snap_root;
 
273
            if (sroot)
 
274
            {
 
275
                snap_root = sroot;
 
276
                if (!snap_root.empty() && snap_root[snap_root.size() - 1] != '/')
 
277
                {
 
278
                    snap_root += '/';
 
279
                }
 
280
            }
 
281
 
 
282
            result += snap_root + custom_exec_arg + " ";
270
283
        }
271
284
    }
272
285
    result.resize(result.size() - 1);