Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
c6a708b5
Commit
c6a708b5
authored
20 years ago
by
rtoy
Browse files
Options
Downloads
Patches
Plain Diff
Try not to crash if the envvar PATH is empty or non-existent.
parent
2df7ff23
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lisp/lisp.c
+19
-16
19 additions, 16 deletions
lisp/lisp.c
with
19 additions
and
16 deletions
lisp/lisp.c
+
19
−
16
View file @
c6a708b5
/*
/*
* main() entry point for a stand alone lisp image.
* main() entry point for a stand alone lisp image.
*
*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.c,v 1.4
2
2004/07/
08 17:49
:0
4
rtoy Exp $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.c,v 1.4
3
2004/07/
30 18:11
:0
8
rtoy Exp $
*
*
*/
*/
...
@@ -171,18 +171,21 @@ default_cmucllib(const char* argv0arg)
...
@@ -171,18 +171,21 @@ default_cmucllib(const char* argv0arg)
struct
stat
buf
;
struct
stat
buf
;
#ifdef DEBUG_LISP_SEARCH
#ifdef DEBUG_LISP_SEARCH
fprintf
(
stderr
,
"User's PATH = %s
\n
"
,
path
);
fprintf
(
stderr
,
"User's PATH = %s
\n
"
,
path
?
path
:
"<NULL>"
);
#endif
#endif
cwd
=
malloc
(
MAXPATHLEN
+
strlen
(
argv0arg
)
+
100
);
cwd
=
malloc
(
MAXPATHLEN
+
strlen
(
argv0arg
)
+
100
);
cwd
[
0
]
=
'\0'
;
if
(
p
==
NULL
)
{
if
(
path
)
{
p
=
argv0arg
;
}
if
(
p
==
NULL
)
{
p
=
argv0arg
;
}
for
(
p1
=
path
;
*
p1
!=
'\0'
;
p1
=
p2
)
{
for
(
p1
=
path
;
*
p1
!=
'\0'
;
p1
=
p2
)
{
p2
=
strchr
(
p1
,
':'
);
p2
=
strchr
(
p1
,
':'
);
if
(
p2
==
NULL
)
if
(
p2
==
NULL
)
p2
=
p1
+
strlen
(
p1
);
p2
=
p1
+
strlen
(
p1
);
strncpy
(
cwd
,
p1
,
p2
-
p1
);
strncpy
(
cwd
,
p1
,
p2
-
p1
);
cwd
[
p2
-
p1
]
=
'/'
;
cwd
[
p2
-
p1
]
=
'/'
;
cwd
[
p2
-
p1
+
1
]
=
'\0'
;
cwd
[
p2
-
p1
+
1
]
=
'\0'
;
...
@@ -200,19 +203,19 @@ default_cmucllib(const char* argv0arg)
...
@@ -200,19 +203,19 @@ default_cmucllib(const char* argv0arg)
}
}
if
(
*
p2
==
':'
)
{
if
(
*
p2
==
':'
)
{
p2
++
;
p2
++
;
}
}
}
}
if
(
p1
==
p2
)
{
if
(
(
p1
==
p2
)
||
(
p2
==
NULL
))
{
cwd
[
0
]
=
'\0'
;
cwd
[
0
]
=
'\0'
;
}
else
{
}
else
{
cwd
[
p2
-
p1
+
1
]
=
'\0'
;
cwd
[
p2
-
p1
+
1
]
=
'\0'
;
}
}
#ifdef DEBUG_LISP_SEARCH
#ifdef DEBUG_LISP_SEARCH
fprintf
(
stderr
,
"User's PATH, Final cwd %s
\n
"
,
cwd
);
fprintf
(
stderr
,
"User's PATH, Final cwd %s
\n
"
,
cwd
);
#endif
#endif
}
}
}
/* Create the appropriate value for CMUCLLIB */
/* Create the appropriate value for CMUCLLIB */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment