mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
[smjs] usage of utils/string functions
This commit is contained in:
parent
3cf1559bc6
commit
985a92c079
@ -112,19 +112,20 @@ console_log(JSContext *ctx, unsigned int argc, JS::Value *vp)
|
||||
struct ecmascript_interpreter *interpreter = JS_GetContextPrivate(ctx);
|
||||
JS::CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
if (argc != 1) {
|
||||
if (argc != 1)
|
||||
{
|
||||
args.rval().setBoolean(false);
|
||||
return(true);
|
||||
}
|
||||
|
||||
unsigned char *key= JS_EncodeString(ctx, args[0].toString());
|
||||
|
||||
char log_fname[8192]="";
|
||||
strcat(log_fname,elinks_home);
|
||||
strcat(log_fname,"console.log");
|
||||
char *log_fname = stracpy(elinks_home);
|
||||
add_to_strn(&log_fname,"console.log");
|
||||
|
||||
FILE *f = fopen(log_fname,"a");
|
||||
if (f) {
|
||||
if (f)
|
||||
{
|
||||
fprintf(f, "%s\n", key);
|
||||
fclose(f);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user