- 论坛徽章:
- 0
|
最近正在攻读perl解释器的源代码,下面这段代码来自perl,真把人看的眼晕了, stripcc正好可以解决问题,GOOD!
- #ifdef DOSISH
- #define PERLLIB_SEP ';'
- #else
- #define PERLLIB_SEP ':'
- #endif
- #ifndef TAINT /* Can't allow arbitrary PERLLIB in setuid script */
- incpush(getenv("PERLLIB"));
- #endif /* TAINT */
- #ifndef PRIVLIB
- #define PRIVLIB "/usr/local/lib/perl"
- #endif
- incpush(PRIVLIB);
- (void)apush(stab_array(incstab),str_make(".",1));
- str_set(&str_no,No);
- str_set(&str_yes,Yes);
- /* open script */
- if (scriptname == Nullch)
- #ifdef MSDOS
- {
- if ( isatty(fileno(stdin)) )
- moreswitches("v");
- scriptname = "-";
- }
- #else
- scriptname = "-";
- #endif
- if (dosearch && !index(scriptname, '/') && (s = getenv("PATH"))) {
- char *xfound = Nullch, *xfailed = Nullch;
- int len;
- bufend = s + strlen(s);
- while (*s) {
- #ifndef DOSISH
- s = cpytill(tokenbuf,s,bufend,':',&len);
- #else
- #ifdef atarist
- for (len = 0; *s && *s != ',' && *s != ';'; tokenbuf[len++] = *s++);
- tokenbuf[len] = '\0';
- #else
- for (len = 0; *s && *s != ';'; tokenbuf[len++] = *s++);
- tokenbuf[len] = '\0';
- #endif
- #endif
- if (*s)
- s++;
- #ifndef DOSISH
- if (len && tokenbuf[len-1] != '/')
- #else
- #ifdef atarist
- if (len && ((tokenbuf[len-1] != '\\') && (tokenbuf[len-1] != '/')))
- #else
- if (len && tokenbuf[len-1] != '\\')
- #endif
- #endif
复制代码 |
|